Questions tagged as 'c#'

1
answer

Send via Json data to the controller

I am trying to send via Ajax some data from my form. In this form, I have inputs normal fields and a list of providers that I previously selected through the checkbox. Follow screen: I'mcreatingtheJSONobjectandsendingitviaAjax,butmyli...
asked by 21.09.2015 / 21:09
1
answer

Generate header when exporting data to excel

I did an export routine for excel , using StreamWriter , but it gives me a problem. I can not get the name of the columns that come in the select. For me to do the header, I had to put it in the hand. This would not be the problem, t...
asked by 12.01.2016 / 11: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
2
answers

Async / Await with threads (C # 7.2)

I have this code and as you can see I created two examples, Parallel and NotParallel. I was hoping that both of them would return me 3000ms, as both should run async (2000 and 3000) and the total time would be 3000, but the NonParallel, is ta...
asked by 20.04.2018 / 14:24
1
answer

What is it and how does it repeat in C #?

for (int i = 0; i < palavra.Length; i++) What does each word mean? And how does each part of this code work?     
asked by 15.09.2017 / 13:04
3
answers

Drag and Change the Position of a GroupBox at Runtime

I have a groupbox that I want the user to be able to drag and change the position at runtime, does anyone figure out any way to do that?     
asked by 17.10.2017 / 19:34
2
answers

Count how many pixels of a color the image has

I'm working on a solution for tattoo studios. I would like to know how it would be possible to determine how many pixels of a given color exists in the image inserted in pictureBox1 . In this image, for example, would it be possible...
asked by 28.12.2015 / 01:50
4
answers

In C # can I use a local alias for class or namespace?

In languages such as Python or PHP you can use a local alias for classes or namespaces . PHP example: use Vendor\Package\ClassName as C; use Vendor\Package as P; $class = new C; $class = new P\ClassName; Python example: from jso...
asked by 14.06.2016 / 17:51
3
answers

How to check if the program is already running in C #

I would like to know if there is a way to check if a program instance is already running, so in case I click the program icon it does not call a new instance of the program, but open the already active program. I need the code in C #.     
asked by 19.04.2017 / 16:17
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