Questions tagged as '.net'

1
answer

Method is executed by clicking the button despite making "button01.Enabled = false"

I want to disable a button while the method does not finish. I used button01.Enabled = false; , but even clicking while the button is disabled, the method is called again after it finishes. For example, when I execute the method below a...
asked by 10.08.2017 / 18:03
1
answer

I can not add a reference to my program

I need to use this structure. The problem is that I can not find it in the .NET Framework. I already added a reference to System.Numerics and I put using , but I still can not use it. I also tried to add a reference to System.N...
asked by 30.07.2017 / 00:36
1
answer

File close

I need to leave the file free, without being in use because it is barring. Here is the code: StringWriter sw = new StringWriter(); XmlTextWriter tw = new XmlTextWriter(sw); XmlSerializerNamespaces xsn = new XmlSerializerNamespaces(); xsn.Add(...
asked by 18.08.2017 / 14:09
1
answer

Run a program with internal arguments

How can I create a Process , start it without allowing any user to see the arguments? Ex:    Executable: MyGame.exe       Arguments: -userid 0 -userpwd 0 But without allowing the task manager or other method to know which comman...
asked by 29.05.2017 / 00:17
1
answer

How to cancel the execution of a function in C # [closed]

I'm developing a desktop application in C # WPF where there is a function responsible for sending email EnviarEmail() , when this function is executed it takes a certain amount of time for it to run completely. And when it is being execute...
asked by 05.07.2017 / 15:49
1
answer

Retrieve SqlCommand as string

I need to retrieve a DB information with a select and compare it to what the user is typing if they are different information, I allow the insert. If the comparison is the same I do not insert and display error message. Here's what I'm trying...
asked by 05.07.2017 / 16:51
1
answer

List web file folder

I'm trying to list a files folder, I'm not getting it, The error says that directoryinfo does not support URLs. DirectoryInfo directoryinfo = new DirectoryInfo("http://127.0.0.1"); IEnumerable<FileInfo> fileList = directoryinfo.GetF...
asked by 14.05.2017 / 20:40
2
answers

Add the random data

I have a code for a data roller. Then the person will type in the field the amount of data that will roll and after that the program will rotate the amount of data and add up. Then I made an array to receive this data but I can not add them...
asked by 07.07.2017 / 23:48
1
answer

Value is not added to a variable within a function

I'm doing a simple quiz program with questions and answers, with punctuation. My problem is this: I made a function so that every time the answer is right, +1 is added to the punctuation variable. public static int pontu1 { get; set; } pu...
asked by 12.03.2017 / 15:49
1
answer

Would it be correct to use a static class to consume a web service?

A question that comes up when I'm programming when it comes to programming static classes. Microsoft's official documentation says the following about static classes:    The static class can be used as a convenient container for sets of...
asked by 05.03.2017 / 06:06