Questions tagged as '.net'

3
answers

Formatting Strings for RG

How can I format this String : 12345678x for this: 12.345.678-X? I tried to use String.Format but I could not. Resolved: public string RgFormat(object rg) { string strRg = rg.ToString(); return strRg.Substring(0, 2) + "."...
asked by 19.03.2015 / 19:49
1
answer

Double Encryption

A colleague told me that he created a crypto class that implements 4 algorithms: TripleDESCryptoServiceProvider Class DESCryptoServiceProvider Class RC2CryptoServiceProvider Class RijndaelManaged Class He told me that he d...
asked by 04.01.2017 / 17:56
1
answer

String Contains Empty returns true

Why does using Contains("") in a string non-empty return true? Example if ("MinhaString".Contains("")) { Console.WriteLine("String contém vazio"); }     
asked by 21.11.2017 / 17:30
3
answers

Group by interval of days using Linq

How can I use interval grouping with Linq? var dados = new[] { new { Id = 0, dias=100, preco= 25, Nome="etc"}, new { Id = 1, dias=40, preco= 50, Nome="etc1"}, new { Id = 2, dias=50, preco= 55, Nome="etc2"}, new { Id = 3, d...
asked by 08.06.2017 / 21:57
2
answers

Capture text between two known characters

I need to get some text and find the words (or phrases) that are between two specific characters { and } , in this case. > I can do this by capturing the delimiters together, using the expression {(.*?)} , but I need th...
asked by 13.01.2016 / 17:57
3
answers

Prevent the system from crashing during a batch email

I'm developing a system that sends batch email to clients, but if the user who is operating the system clicks on any part of the window during the process, it appears that the system is not responding, interrupting the sending process . I wou...
asked by 21.01.2015 / 21:25
1
answer

Can a class be a data type?

What I understand about data type is that they are formed by three properties, they are: Address set; Operations Set; Memory Space; Assuming what is above I can understand that a class I create for example class Pessoa : pub...
asked by 17.02.2016 / 01:04
4
answers

Instantiate class as property of another class

I have two classes created within the same namespace , being: public class Pessoa { public int idPessoa { get; set;} public string nome { get; set;} } public class PessoaFisica { public Pessoa pessoa { get; set;} public...
asked by 09.05.2014 / 14:16
2
answers

Terminate a process in C # with WPF

I have a solution that has two projects. one main project and one that serves as an Updater. To perform the upgrade, within the main project, I call a console application as follows. private void Window_Loaded(object sender, RoutedEventArgs...
asked by 08.04.2014 / 14:27
1
answer

What are the differences between ViewBag, ViewData, and TempData?

I was researching how to pass data to a view , or rather persist the data of a controller to the view . I would like to know among the 3 ways mentioned in the title: What are the differences between them? In which cases is the use o...
asked by 01.02.2018 / 15:12