Questions tagged as '.net'

3
answers

Why declare properties twice in a class?

When declaring a property in a class, they usually declare twice, one public and the other private. What is the purpose? private int _years; public int Years { get { return _years; } }     
asked by 17.05.2017 / 18:39
1
answer

Capturing sound from a microphone in Windows via C #

How do I capture the audio that the microphone receives in Windows with C #? I want to develop a software that receives external sound and based on it it changes the volume of my computer.     
asked by 29.01.2016 / 17:21
3
answers

Check if int is "null" in C #

In C # it is not possible to assign null to an integer value ( int , not int? ). However, how can I tell if an integer value ( int ) has not yet had an assigned value (being int )? int? valor; if (valor == nul...
asked by 15.08.2017 / 17:10
3
answers

How useful is FuncT, TResult

I was researching a few things and came across Func<T, TResult> , and I did not quite understand the utility of it. For example: //Método public string Nome(string nome) { return "Meu nome é " + nome } //Ao utiliza-lo eu ch...
asked by 11.06.2015 / 21:15
4
answers

Is there a C # functionality similar to PHP __call?

I have a lot of experience with PHP, and as I'm starting with C # now, it's going to be common for me to want to compare one language with another to find out if I can do something similar. In PHP, I can add a functionality to a class so that...
asked by 28.06.2016 / 16:18
3
answers

Inserting registry and retrieving ID generated by SQL Server 2012

I want to insert a record into a table, retrieve the ID that was generated by AUTO_INCREMENT and insert records into other tables, using that ID. But, I want to do this all using BeginTransaction . How could I do this? I'm doi...
asked by 23.11.2015 / 12:49
3
answers

How to separate a String according to a tab in C #?

I have a string in this format: string valores = "Numero1#Numero2#Numero3#Numero4#"; How do I debit it in an integer array to get this: int Numero[1] = Numero1; int Numero[2] = Numero2; int Numero[3] = Numero3; int Numero[4] = Numero4;...
asked by 02.05.2014 / 19:07
4
answers

Get random element from a ListT

I have List<int> numeros Is it possible to return a random element from this list?     
asked by 09.07.2014 / 16:12
3
answers

I need to sort a list in order that seems incoum

I have a query and I want to sort this query by the code attribute. I did this: consulta.OrderBy(c => c.Codigo); Result obtained: 1.01 1.A 14.04 14.11 22.01 3.04 30.01 4.01 40.02 Expected result: 1.01 1.A 3.04 4.01 14.04 14.11 22....
asked by 19.12.2016 / 20:34
4
answers

Function within another

In JavaScript, I can structure my code well by putting auxiliary functions inside other functions. For example: Can I get something similar in C #? If not, how do you do not leave the auxiliary functions "loose" in the project? function Sal...
asked by 29.09.2015 / 16:54