.net-3.5

Simplest way to perform data validation for fields on Windows Forms

青春壹個敷衍的年華 提交于 2021-02-07 13:41:37
问题 I have a windows form project in which I want to force the user to enter values in certain fields before he presses the calculate button at the bottom. The fields include three pairs of radio buttons , five text boxes and one combo box . So basically all these fields need to contain a value in order to perform the calculations. Additionally, the text boxes should contain numbers - any double values. Moreover, I want to set a maximum value set for most of these text boxes which the user cannot

Simplest way to perform data validation for fields on Windows Forms

℡╲_俬逩灬. 提交于 2021-02-07 13:41:24
问题 I have a windows form project in which I want to force the user to enter values in certain fields before he presses the calculate button at the bottom. The fields include three pairs of radio buttons , five text boxes and one combo box . So basically all these fields need to contain a value in order to perform the calculations. Additionally, the text boxes should contain numbers - any double values. Moreover, I want to set a maximum value set for most of these text boxes which the user cannot

Format Removable media with c# programming

最后都变了- 提交于 2021-02-05 04:54:22
问题 I want to format (FAT32) removable drive with c# programming. In the internet I found a way, but the problem is that it opens the generic windows format program. But I want to do it with C# only and no built in windows support. My method is: // FAT32 Format Button click event [DllImport("shell32.dll")] static extern uint SHFormatDrive(IntPtr hwnd, uint drive, uint fmtID, uint options); 回答1: You can use wmi, there is a method that allow this. http://msdn.microsoft.com/en-us/library/aa390432

Format Removable media with c# programming

纵饮孤独 提交于 2021-02-05 04:53:11
问题 I want to format (FAT32) removable drive with c# programming. In the internet I found a way, but the problem is that it opens the generic windows format program. But I want to do it with C# only and no built in windows support. My method is: // FAT32 Format Button click event [DllImport("shell32.dll")] static extern uint SHFormatDrive(IntPtr hwnd, uint drive, uint fmtID, uint options); 回答1: You can use wmi, there is a method that allow this. http://msdn.microsoft.com/en-us/library/aa390432

How to pass arguments to an HtmlFile?

北城以北 提交于 2021-02-04 21:53:08
问题 How to pass arguments to an HtmlFile from C#? Like: System.Diagnostics.Process.Start("Sample.html","Arguments"); If I execute the above code the "Sample.html" file should be opened and it should do something with the "arguments". 回答1: Process.Start( @"C:\Program Files\Internet Explorer\iexplore.exe", "file:///c:/path/to/file/Sample.html?param1=value1" ); UPDATE: To figure out the default browser location: class Program { [DllImport("shell32.dll")] public extern static int FindExecutable(

Which version of the .Net framework is my assembly actually running?

梦想的初衷 提交于 2021-01-27 20:11:41
问题 Just a little setup. We have the .Net framework 3.5, 4.0, 4.5, and 4.6.1 installed. If we build a .Net application or assembly using .Net framework 3.5 and then we set the app.config to run using a single supported runtime of 4.6.1: <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup> Which version of the framework is actually being utilized? This question came from from reading this post: How do I force an application compiled to target .NET Framework 4 to