Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
7
votes1
answer976
viewsHow to move files read by Streamreader in C#?
I am trying to move some files. For each file containing the word "TEST" in its body, my application indicates being a found item. The goal is to move them to another directory. Follow the code…
-
7
votes1
answer580
viewsDependency registration responsibility (Ioc, DI, n-layer architecture)
I’m starting a WPF (.NET/C#) project using an n-layer (Domain Driven Design) architecture, and to implement Control Inversion and Dependency Injection (Ioc/DI), I’m trying to use Microsoft’s Unity…
-
7
votes5
answers2024
views -
7
votes3
answers2007
viewsHow to obtain information from an SSL Certificate via C#?
How to obtain information (expiry date for example) from an SSL certificate via C#?
-
7
votes2
answers129
viewsBoxing is copying the data
Boxing is to transform value type in Reference type, right? But when we copy a Ference type into another Reference type, it just copies the address and not the value. But when I convert int for…
-
7
votes2
answers1287
viewsConvert Base16 string (Hexadecimal) to Base10 (Decimal)
I have the following string "615769EF", hexadecimal. How to convert it to base10 and let the result be the string "01633118703" ?
-
7
votes1
answer1504
viewsHow to publish a . EXE secure, other than through Click Once . Net
My scenario is composed as follows: I have applications, which are configured according to each customer, are apps sold in bulk, I have a support system, which automates this configuration and…
-
7
votes4
answers5703
viewsSchedule process execution in C#
I have an application that will run 24h/day the 7 days/week, IE, It will always be running. I need that at a specific time, every day a method of this application is called.
-
7
votes2
answers1801
viewslist.foreach vs foreach
I have a list of several string, there’s a difference between going through the list values: In this way: ListaString.ForEach(delegate(string str) { Console.WriteLine(str); }); Or this:…
-
7
votes2
answers607
viewsResource on an Enum
I have a enum and would like to change the Description with Resource: public enum SystemArea { [Description("Gestor")] Gestor = 3, [Description("Administrador")] Administrador = 2,…
-
7
votes1
answer182
viewsIs it possible to use MD6 in C#?
Speaking of hash, it is possible to use MD6 in C#? Someone would have an example of the use in a simple string? In my research I found nothing very objective.
-
7
votes2
answers5391
viewsHow to update an item from a generic list?
I am trying to change the name and email of a particular item in the list below, but I couldn’t find another way to remove the item from the list and add it again updated. There is another way to…
-
7
votes3
answers2024
viewsKeep application (Windows Form) open in icon tray with C#
How to do that when closing the application (either by close button, ALT F4, or any method other than the process manager), the application continues running in the Windows icon tray: And it is very…
-
7
votes3
answers660
viewsLINQ corresponding to SQL with clause LIKE 'XXX%'
I am using the following LINQ to return a query: .Where(c => c.Nome.Contains(nome)).OrderBy(c => c.Nome) But if the name is Maria, he brings: José Maria Maria José How to bring organized as if…
-
7
votes1
answer115
viewsInternal X public access modifier
When using public or international? Is there any advantage/disadvantage between them?
-
7
votes3
answers2045
viewsInserting record and recovering ID generated by SQL Server 2012
I want to insert a record into a table, recover the ID that was generated by AUTO_INCREMENT and insert records into other tables using this ID. But, I want to do this all using the BeginTransaction.…
-
7
votes2
answers1283
viewsHow to convert ASCII to binary?
I’m trying to implement the conversion of a text to binary, I found one on the internet: static string ASCII_binary(string texto) { string converted = string.Empty; byte[] byteArray =…
-
7
votes1
answer451
viewsWhat is the advisable way to mount a query?
What is the advisable way to mount a query in C#? It is advisable to use concatenation with the operator +? For example: query += " WHERE nome LIKE '%" + nome + "%'"; Here follows a query I set as…
-
7
votes2
answers642
viewsError while trying to update table using C#
I created a form to change a table, but my update is not working. cnxCli.sel =/*"set dateformat dmy \n"+ */ "update Cliente" + "set Nome = '" + txtNome.Text +"'," + "Rg = '" + mskRg.Text + "'," +…
-
7
votes1
answer1464
viewsSimple permutation algorithm
I’m trying to create a simple permutation algorithm where you pass any number for example 123 and it should return the largest number without repeating. I tried something like this more when I pass…
-
7
votes2
answers1242
viewsHow to multiply an "X" character as many times as you want?
Is there a method that multiplies an "X" character as many times as I want? example: I have the character "P" P x 5 = "PPPPP" Is there any ready method in . Net?…
-
7
votes2
answers2701
viewsWhich is more secure: Session or cookie?
Thinking about security guard, what is the best option to keep the user logged in an ASP.NET MVC application, the cookie or the Session?
-
7
votes3
answers1360
viewsFaster way to access properties in a C#list
I have a project that works with a large volume of data, and I need to optimize it to bring results of some calculations in a considerably small time. I know that I have several aspects to take into…
-
7
votes1
answer488
viewsXamarin.Forms Portable or Xamarin.Forms Shared
What is the difference between a Xamarin.Forms Portable or Xamarin.Forms Shared project?
-
7
votes2
answers664
viewsWhat are the advantages of Parallel.Foreach in C#?
Working with C# I saw that we have the option to work with parallel.ForEach(). What is the advantage of working with her and not the foreach?
-
7
votes2
answers235
viewsHow to create a cross-platform app?
Come on and create a cool app, a system based on Console Application, written in Visual Basic.NET, in . NET Framework, ai you want port this application to other platforms, but without creating a…
-
7
votes3
answers414
viewsHow to change the structure of a LINQ query at runtime?
I have the following example of a program that implements the EF (Entity Framework). The structure of the database and the application is defined as follows: Table Pessoa: Primary key field:…
-
7
votes3
answers1496
viewsWhy is it possible to define two or more methods with the same name in the same class in C#?
I’m starting my C# studies with ASP.NET MVC today. I’m still adapting to some things I’m not used to seeing, because I know languages like PHP, Python and Javascript. I realized that in a code that…
-
7
votes2
answers3200
viewsCode protection . NET
I have a C# application that I developed, it will be installed in several clients. The problem is that I have to protect the application code, because I performed some tests with the Ilspy…
-
7
votes2
answers355
viewsHow to use Windows Forms components in a WPF application?
Is there any way to use Windows Forms components in WPF? For example, I need to use control Chart or the MaskedTextBox from Windows Forms, which does not exist in WPF applications, as I could use it…
-
7
votes1
answer239
viewsProject Dependency Injection . Net Web API 2
I am involved in a project that is developing an application .Net Web API 2 Fw 4.51 (with a view to future migration to .Net Core, what is an 'aggravating'), Fluent NHibernate e PostgreSQL, and we…
.net asp.net-web-api dependency-injection asp.net-core iocasked 8 years, 1 month ago Carlos Felippe Vernizze 71 -
7
votes3
answers190
viewsConsole, Windows Forms or MVC what’s the fastest for heavy loads?
I’m developing a program that will basically have the following cycle: Database query(some milliseconds) For each record will perform the following process: Início | Parse de um XML web (alguns…
-
7
votes2
answers808
viewsHow to save program settings, database or configuration file?
In my application, the admin user, can make some settings, for example: Configure if you want to use specific product templates, or stay open for the end user to type. Configure if you want to use…
-
7
votes1
answer153
viewsWhat is an equal input parameter (allocation operator)?
I have a function defined as follows: public classeDeRetorno nomeDaFunção(string param1, string param2, string param3 = "") What does the param3 = ""? It equals the parameter to ""?…
-
7
votes3
answers312
viewsTransform a string into multiple substrings whose contents are between apostrophes
I am creating a program in C# that reads a text file and one of the lines of that file has the following format: 'Column 1' 'Column 2' 'Column 3' I want to turn that line into one array of strings…
-
7
votes3
answers566
viewsSame types but with different objects. What is the best way to use it?
I had to create a new object but totally the same as the one in the C#system. Since the objects are the same I tried to do: ObjetoOriginal.Propriedades = ObjetoClone.Propriedades; Unfortunately it…
-
7
votes1
answer352
viewsHow to allocate an immense amount of memory?
I created an Onfly encryption algorithm that encrypts bytes without the need to copy them to a new copy of those same bytes. This is both to encrypt and to decrypt these byte lists. As in the scheme…
-
7
votes2
answers753
viewsDaylight saving time with old dates
In my system save all dates on UTC, but in the user view I show in GMT -3. The problem is when I save a date in summer time, because in case it will no longer be made the difference of 3 hours, it…
-
7
votes2
answers674
viewsRemove an N amount of days on a date
How to remove an amount of N days in a date ? namespace TesteData { class Program { static void Main(string[] args) { var dataAtual = DateTime.Now.Date; // dataAtual 13/09/17 var qtdDias = 5; //Como…
-
7
votes1
answer3980
viewsIn which cases return the System Exception error.Outofmemoryexception
Which are the most frequent cases that can return this Exception?
-
7
votes1
answer115
viewsWhy is the expression (double.Minvalue == double.Minvalue + 1) true?
The following code C#: public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(double.MinValue == double.MinValue + 1); Console.WriteLine(int.MinValue…
-
7
votes3
answers6315
viewsHow to make an "Insert" with Dapper using a class?
I’m testing Dapper and when I try to use a class I found the error: Must declare the scalar variable Follows the code: public class Teste { public int id; public string nome; public int idade; }…
-
7
votes2
answers74
viewsWhat is the best type to store area, volume, perimeter?
Decimal, Numeric or Float. What is the best option for storing area or volume? I would use Decimal, but I would like to see the opinion of others as well. I guess not, but the right guy or the next…
-
7
votes2
answers684
viewsUse of interfaces in domain classes?
The project analyst I’m working on as a C# programmer vigorously defends the concept of SOLID in development. And it says that one of the requirements to use it is to have interfaces for everything.…
-
7
votes1
answer177
viewsGuid.Parse() or new Guid()?
What’s the main difference between using the options Guid.Parse() or new Guid() to convert a string in a Guid? And which of the two approaches would be best used? var usuarioId = new…
-
7
votes2
answers1093
viewsReplace empty or blank letter, something like Replace("letters","")
There is a field in the database A1_ZTEL he is varchar(15). This way each user entered record of all forms, with bar, point, comma and letter. Now I need to ride a form and read this field from…
-
7
votes7
answers1103
viewsRemove part of string until nth occurrence of a character
I have a string that always returns in any of these formats: "0001>0002>0003>0004>0005" "abcdef>ghi>jkl>mnopqr>stuvx" Always has the character > dividing something.…
-
7
votes1
answer424
viewsWhat is the difference between using normal methods and Action or Func?
public Action<string> Escrever = (texto) => { Console.WriteLine(texto); }; Might call it that Escrever.Invoke("Algum texto aqui dentro"); VS public string Escrever(string texto) {…
-
7
votes1
answer2211
viewsIs there a module function of a number in C#?
Example : module of -1 (|-1| = 1). I’ve done some research on the internet but all I think is the division module (%). I am trying to circumvent the common way of passing a negative number to a…
-
7
votes2
answers142
viewsWhat does byte* mean?
I’m studying cryptography and I took an example in AES. In the code is this byte* and even *variavel and I couldn’t understand what it meant. This is the block that uses this, quoted above: byte*…