Questions tagged as '.net'

2
answers

Check if the previous day is a holiday and / or Sunday

I'm having trouble developing a date validation logic. The variable dataFecha is called with -1 day to already validate the previous day. But when I test the validations, he did not subtract (-1) day in the variable, to validate the Sa...
asked by 13.12.2017 / 12:43
1
answer

What is ADO.Net for C #?

I'm starting to learn about C # for Web applications, and wanted to know what is ADO.Net and what are the advantages of using it?     
asked by 04.10.2015 / 17:25
2
answers

How to convert ASCII to binary?

I am trying to implement the conversion of a text to binary, I found one through the internet: static string ASCII_binary(string texto) { string converted = string.Empty; byte[] byteArray = Encoding.ASCII.GetByt...
asked by 30.11.2015 / 13:25
1
answer

In a console program in C #, where is the main class defined?

I'm doing my first console program in C #, just to do some testing. I have two classes: HelloConsole.MainClass and HelloConsole.Calc . I have the following code: using System; // Aprendendo o alias de namespace using C = S...
asked by 14.06.2016 / 18:37
2
answers

list.foreach vs foreach

I have a list with several string , there is a difference between scrolling the list values: This way: ListaString.ForEach(delegate(string str) { Console.WriteLine(str); }); Or this: foreach(string str in ListaString) { C...
asked by 06.08.2015 / 14:01
2
answers

Static classes and classes with static methods

When I declare a class static , I am required to write my static methods and this class can never be instantiated. Now, I have a common class and create my methods inside it all static. Well, I even consider this static class, for consider...
asked by 27.02.2015 / 15:22
2
answers

How do I make "Replace" replace all occurrences of a word regardless of case?

The Replace function replaces all occurrences of a word or expression, but is case sensitive: string str = "Hello WorLLd";//Substitui só os 'l' e não o 'L' str = str.Replace("l", "EL"); Console.WriteLine("My string: " + str); Output:...
asked by 11.09.2014 / 23:16
2
answers

Remove "/" from a DateTime.ToShortDateString ();

I'm implementing a program using C # with .NET 3.5 I have the following code: StringBuilder sb = new StringBuilder(); sb.Append(caminhoSalvarCobranca); sb.Append(@"\Boleto "); sb.Append(boleto.Sacado.Nome); sb.Append(boleto.Boleto.DataVenci...
asked by 28.05.2014 / 18:31
4
answers

How does an empty constructor work?

Definition: Creating an empty constructor If the attributes are not set, they will be set to the default type , example: int default value is zero. > Context: I use a structure that returns entities from the database and when the o...
asked by 24.04.2014 / 23:29
1
answer

Method that returns a class

I'm trying to create a method that takes a string and returns an instance of the class with the last name, eg "Calculator", will return me an instance of class "Calculator" time to determine which type it returns, because from what I researched...
asked by 07.05.2014 / 20:50