Questions tagged as '.net'

1
answer

How to invert control list of Control.ControlCollection?

I am inserting in a Panel several Labels, as I am inserting, the first Label becomes last in the Panel. But I wanted to reverse this process. I wanted the first Label that was inserted, to be first in the Panel, and not last. private void Form...
asked by 19.08.2018 / 19:23
1
answer

AsParallel () .ForAll vs async await

When using AsParallel().ForAll , and when to use async await ? I'm providing an example with a download routine and a file manipulation routine. AsParallel().ForAll performs better in parallel download operation. as...
asked by 14.11.2018 / 17:59
1
answer

.NET Core and Mono: development of applications for Linux

I've currently needed to develop desktop applications for Linux, and one of the requirements is that it would have to be using C # . And by researching / testing, I had two options: .NET Core or Mono . When I used Mono , I lost...
asked by 24.07.2018 / 14:14
3
answers

Protecting the connection string in a .NET Winforms application?

I have a .NET Windows Forms application that connects to a SQL Server server directly, without the use of an intermediate layer like a WebService > or WebAPI , by SqlConnection . This application is installed on the client's compute...
asked by 07.02.2014 / 18:47
1
answer

POST in Web API returns Invalid Content Type

I'm trying to send a POST request to a Web API. If I do it by Postman, it works: NowwhenItrytoexecutethroughcode,Igetthefollowingerror:{"status": false, "message": "Content Type Inválido. (Formato aceito: Content Type = \"application/...
asked by 23.03.2018 / 18:41
1
answer

Why add a variable, property, method, etc. in a string does it work?

When I add a variable, property, method, enumerator, etc. in a string , it works, even though I do not call the ToString() method for example. Example with type and integer: var example = typeof(bool); var exampleInteger = 12; Con...
asked by 13.02.2018 / 19:49
1
answer

What are the "User" and "CancellationToken" parameters used for?

I'm doing an implementation with API of Google Drive, and in the code block: credenciais = GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets, new[] { DriveServ...
asked by 22.12.2017 / 14:34
1
answer

Perform crawling and debugging in .NET

While developing an application, there are times when I get lost and I want to understand how my code is running. For example, in which iteration of a given loop of repetition it is, what is the value of a given variable. Until then I did thi...
asked by 19.12.2017 / 13:34
1
answer

Multiple select list with items already selected using Razor

I'm using Razor to generate a SelectList like this: @Html.DropDownList("StatusImovel", new SelectList(ViewBag.ListaStatus, "IdStatus", "Descricao"), new { @hidden = "hidden", @multiple = "multiple", @form = "nulo" }) I need it...
asked by 03.01.2018 / 13:42
1
answer

Show specific error in ASP.NET MVC

I created a website that works normally, but when I upload it to the hosting server, it shows an error:    Application Server Error '/'. As the error is very generic, it says to include the line <customErrors mode="Off"/> in m...
asked by 28.10.2017 / 15:21