Questions tagged as '.net'

3
answers

Lists repeating last item added

I was studying about the lists in C # and I could not understand what's wrong with my code (it's probably going to be pretty basic), all items are the same as the last item added. I've simplified the code to focus on just that part of the erro...
asked by 09.10.2017 / 15:47
3
answers

Filter specific file not to delete

How to make the code not delete a specific file I want among the .exe I get. Example: I want it not to delete "test.exe", but still keep erasing everything else. Follow the code: string[] arquivos = Directory.GetFiles(@"C:\temp\ae",...
asked by 28.05.2018 / 20:23
4
answers

Compare number within a numeric range

I want to create a function that receives a number and check that it is within a range of 1 to 25. What is the best way to do this? private int VerificaIntervalo(int numero) { if (numero > 25) { return 0; } return 1;...
asked by 19.01.2016 / 18:50
2
answers

Tagging photo with problem

I've made a code that labels a jpg , by typing the client's site address in the image footer. The Problem: Some photos the text is coming giant as if it were source 72px instead of source 12px Correct Photo Link Link wrong PH...
asked by 14.10.2014 / 21:23
4
answers

Is it possible for a JavaScript function to call a method that is in the code behind the page?

I have a button and I wanted to program click of it, and when I use <asp:Button> I program click of it in code behind . I'm now using a button normal. I know almost nothing about JavaScript and wanted to pro...
asked by 11.09.2015 / 20:51
1
answer

What is the purpose of the Uri class?

What is the Uri class and what is its purpose and where should I use it? Can not pass an object from it to a string variable see in the example: String caminho = new Uri(@"c:\Windows"); Generate the following error:    Error 1...
asked by 10.03.2016 / 01:30
2
answers

How to change the way in which a class / structure is printed?

I have the following structure: struct cores { int r, g, b; public cores(int r, int g, int b) { this.r = r; this.g = g; this.b = b; } } If I have a new structure printed, it looks like this: Consol...
asked by 10.09.2017 / 03:05
2
answers

Is it correct in MVC to access data within the model?

In a C # MVC project, is it okay to access data within the model ? For example: public class Cliente { public int Id { get; set; } public string Nome { get; set; } //outros atributos... public void Inserir(){ Client...
asked by 26.10.2017 / 16:16
3
answers

How to create login and user in SQL Server passing command line through Visual Studio passing parameters? [closed]

public void CriaUsuarioSystem(string userSystem, string pwSystem) { try { conexao = new SqlConnection(conexao_BD); SqlCommand creatUserSystem = new SqlCommand("CREATE LOGIN @login WITH PASSWORD = @pw " +...
asked by 09.05.2017 / 21:59
1
answer

Dispose () method

dispose() frees the object from memory, right? I do not know when it is necessary to use it. For example, I have a page, on this page there is listBox com visible = "false" , in an event this listBox becomes true...
asked by 23.12.2016 / 14:00