Questions tagged as 'c#'

2
answers

How to know the number of lines a large file has in C #?

Well, I'm starting now in C #, but I already have a great experience with PHP and I know more or less Python . And the means I use to understand is to do something that I found difficult to do in a language I know in a language I do not...
asked by 13.05.2016 / 19:11
2
answers

Customize MessageBox in C #

I have the following MessageBox MessageBox.Show("Deseja iniciar a forma automática?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Can I customize it? Instead of being the YesNo buttons, put...
asked by 04.11.2016 / 17:35
2
answers

How to turn HTML into an image on the server?

I have a Asp.Net MVC project with .Net Framework 4 in Visual Studio, where I need to transform a string with HTML code into a server-side image . I've tried using this library , but I'm open to new options. The code looks like this: Im...
asked by 26.11.2015 / 18:59
2
answers

How do I remove white space from text?

I was trying to get whitespace from a string , but .Trim() does not work, this still displays whitespaces: var teste = texto.Trim(); txtConteudo.Text = teste; For example, if it receives: "text text", it continues: "text text" eve...
asked by 07.10.2015 / 14:12
3
answers

How to catch a NullReferenceException?

When I test my application, it returns some specific data, but when the requested data is null, this unhandled exception error appears ItriedtocapturehimbutIthinkI'mwrong.HowcanIleaveatreatmentthatwarnsinatextboxthattherequesteddatawasnotfou...
asked by 26.11.2015 / 01:24
3
answers

Is there Data Annotation that avoids duplication of data in the Bank?

How do I prevent data being duplicated in the database using Data Annotation or would it be through another validation?     
asked by 10.11.2016 / 16:18
4
answers

How to use unsafe code in a Web Site

I was trying to practice the use of pointers in C #, so I created a website in the following method: public static Nodo[] MontaTree(){ //... código ... } Obviously the above code does not make it possible to use pointers, so we need keywor...
asked by 10.04.2017 / 18:51
3
answers

How to get the executable path open in C #

How do I get the project path in C #? Is there a function? Or do I have to type the full path in my application?     
asked by 12.02.2014 / 19:02
2
answers

Password encryption

I have an Asp.Net MVC project and would like to securely store user passwords in the database. Home The goal is to create something that can not be easily decrypted in a few hours of brute force on a PC (I'm aware that with a little more effort...
asked by 15.09.2015 / 23:24
2
answers

Dividing 1/2 in C #

In some videos in numberphile on the Zeno's Paradox the teacher of the video tried to explain how this paradox worked using the hands to beat palamas (I'm not sure how to explain this but I'll leave the video there in question, please watch...
asked by 15.01.2015 / 14:38