Questions tagged as 'c#'

1
answer

Random always returning the same number

I have a method whose function is to return 25 random numbers in a list: static List<int> criarList() { List<int> lista = new List<int>(); for (int i = 0; i < 25; i++) { lista.Add(new Random().Next(0, 1...
asked by 28.10.2017 / 21:06
1
answer

Can you notify us that there will be a garbage collection?

I am studying about the garbage collector of .NET and wanted to know if there is an event I can sign up to and always know when a collection will be made.     
asked by 08.05.2017 / 16:46
3
answers

Authorization of users to actions that use the Authorize attribute

I put [Authorize] in my controllers and entered this code: <authentication mode="Forms"> <forms loginUrl="/Login/Login" /> </authentication>' For every time code 401 occurs it redirects to the login page, but I...
asked by 18.11.2015 / 17:20
1
answer

What is the difference between a DLL produced with C ++ and a C #

After some time searching, I did not find any results for this issue, the existing MSDN topics also did not return anything regarding the support of the 2 in Windows. In short, the question is, what's the difference after compiling a DLL prod...
asked by 17.11.2015 / 12:20
1
answer

Modify visual element by another thread

I want to define a Thread in a RichTextBox but I get an error saying    Can not make calls from another thread than the same TextBox I've heard that it's possible to use the Control.Invoke option, so I was very much in doubt at th...
asked by 18.10.2015 / 00:46
1
answer

How to sort a list of objects by DUAS properties

In this topic: How to sort list with complex object by one of its properties? is explained how to sort by a property, but how to sort by two? Considering the following product class: +-------------------+--------------------+ | Produto...
asked by 01.04.2014 / 20:57
2
answers

Problem connecting to SQL Server 2012 database in IIS

I can not run queries from my system in IIS, when I run in Visual Studio I get the result quietly. The error I get when trying to do something is as follows:    System.Data.Entity.Core.ProviderIncompatibleException: An error   occurred whi...
asked by 22.03.2014 / 03:06
1
answer

Proxy Connection: HTTP 407 Proxy Authentication Required

I created a project for ASP NET where I want to get the data of an address from the CEP by querying a call from the url in a webservice. On my machine it works normally, however on the machine I work, there is a need for network authenticatio...
asked by 28.04.2015 / 19:23
1
answer

Base64 string signature

In my project, I have a rule that I need to sign the string of an XML that I have that is in base64 with the user's CPF ... I have been searching, but I have not been able to understand how this signature works with .NET classes. Wel...
asked by 12.06.2015 / 14:30
3
answers

Is there a justification for this change? Change in the pattern of variables

A co-worker read in a forum that using short, int, and long was the right and best way for system performance, so it began to change on all the screens and classes in which it worked. I searched and did not see any gain except that there is some...
asked by 15.07.2015 / 19:25