Questions tagged as '.net'

1
answer

How to create a new configSections in App.config

I'm working with an application that currently uses the appSettings section to get application settings through ConfigurationManager.AppSettings . But I would like a more complex structure for my configuration, something like this: &...
asked by 28.09.2015 / 22:16
2
answers

Ignore a specific exception

In my try-catch , I want to write the exception that occurred within an object (for historical purposes, necessary for the business rule, since this section occurs in a processing via integration with external sources). > To do this, I n...
asked by 17.01.2017 / 13:37
2
answers

Keep variable in memory until system reboot

Is there a way to keep a variable in the machine's memory until it restarts? My application made a change in the system and sent the message to the user to restart the machine, to prevent any problems I have to detect if the machine has alrea...
asked by 28.07.2016 / 04:01
3
answers

Array with no size limit

ClsPessoa[] Pessoa = new ClsPessoa[10]; I'm new to C # and would like some help. How can I declare an array of a class as in the example, without inserting a size limit.     
asked by 11.10.2015 / 20:48
3
answers

Problems with logic (&& or ||)

I found the code that is in my system strange: if (cmbCdTipoProcesso.SelectedValue != "3" && cmbCdTipoProcesso.SelectedValue != "4") {....} Apparently the code is strange because I will never have cmbCdTipoProcesso.SelectedVa...
asked by 07.01.2015 / 13:00
3
answers

Error comparing numbers and checking if they are the same

I'm doing a simple C # exercise in which I have to get two numbers, compare them and print which one is the greatest or are the same. When I start the program, I can only put the first number, and before placing the second, the program alread...
asked by 21.06.2016 / 18:15
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