Questions tagged as 'c#'

4
answers

Call function at each time interval efficiently

I have a question, I'm making a game server and I need a specific function to be run every 10 seconds. I know that Thread.Sleep() exists (in combination with while(true) ), but it does not seem to be a good option I've heard o...
asked by 01.09.2016 / 18:25
3
answers

Method returning parent class to child class

I have the following classes: public class Pessoa { public int PessoaId { get; set; } public string Nome { get; set; } public DateTime DataNascimento { get; set; } } public class Cliente : Pessoa { public int ClienteId { get;...
asked by 27.06.2016 / 20:35
2
answers

Protecting data in memory

I have read a lot of articles on cryptography etc ... The encryption reported by the posts was a success in my program, however some data stay in memory being vulnerable to Assembly readers in real time. An example of this is Cheat Engine , w...
asked by 09.04.2016 / 14:18
2
answers

Operator error can not be applied to method group

I'm trying to print a subtraction of dates using C # with WebForms, but I'm not sure how to correctly enter the attributes in the methods or how to print the method. I'm converting the subtraction of the dates into days because I do not know...
asked by 23.04.2016 / 19:57
2
answers

How to lock an executable file and prevent it from opening in Windows?

I would like to create a private program where I can block programs from running in Windows, I know Windows itself provides something basic about this, but I wanted to create my program, someone give me a code hint that blocks any executable fil...
asked by 13.12.2015 / 18:16
1
answer

The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file

I have a project in MVC, and wanted to connect to the MySql database. I put this connectionStrings . <add name="Contexto" connectionString="server=127.0.0.1;User Id=xxxxxx;password=xxxxx;database=iesb_site" providerName="MySql.Data.My...
asked by 21.02.2017 / 15:31
2
answers

Separating static methods into several classes can have a negative impact?

In organization, it is important to separate the methods into different classes. If we organize the methods into different classes in order to create a better organization, can we have a negative impact on program performance? For example,...
asked by 20.01.2017 / 01:35
2
answers

Label in loop in Foreach

I'm having difficulty displaying information that comes from an object to show on a Label, returning it as a list. //Pegando os dados do Rest e armazenando na variável usuários var usuario = response.Content.ReadAsAsync<IEnumerable<Cons...
asked by 27.07.2018 / 14:59
2
answers

Login with network user

When I open the page I'm building, the user logged in by the network will log in to the page with that user, but without having to open a page for it, that is, my system will have to get the guy access the portal / system. I use: VS2013 - MVC...
asked by 13.08.2014 / 02:01
2
answers

How do I access properties of an object that is inside another object?

In the background I want this output Console.WriteLine(cidade1.casas.dono); to return João using System; namespace arrayteste { public class cidade { public string nome { get; set; } public object cas...
asked by 27.06.2017 / 14:47