DeveloperFusion offers a free .NET code converter. Simply paste your C# or VB.NET code into this web-based tool, then select your target language: C#, VB.NET, Python or Ruby. Supports syntax up to .NET 3.5.
Popularity: 1% [?]
DeveloperFusion offers a free .NET code converter. Simply paste your C# or VB.NET code into this web-based tool, then select your target language: C#, VB.NET, Python or Ruby. Supports syntax up to .NET 3.5.
Popularity: 1% [?]
This is one of those “D’oh!” moments. You’re creating your own UITypeEditor. You know the UITypeEditor class is located in the System.Drawing.Design namespace. So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right? Wrong! When you compile your project, the following error may appear:
The type or namespace name 'UITypeEditor' could not be found (are you missing a using directive or an assembly reference?)
It turns out that UITypeEditor is actually defined in System.Drawing.dll, even though it’s located in the System.Drawing.Design namespace. See the disconnect? But you can easily solve this problem by adding to your Visual Studio project a reference to System.Drawing.dll.
Popularity: 1% [?]
When you create a Form with a border, Windows automatically draws a drop shadow around the form, as shown here:

However, if you set the form’s FormBorderStyle property to None, Windows draws neither the form border nor the drop shadow, as shown here:

Popularity: 2% [?]
Click the image above to download a .NET Framework 4 and Extensions poster from Microsoft.
Want more .NET posters? Devcurry has published a collection of .NET Framework and Visual Studio posters including keyboard shortcut, namespace and type posters.
.NET and Visual Studio Poster Collection
Popularity: 1% [?]
To get the path of the current user's temporary folder, call the GetTempPath method in the System.IO namespace:
string tempPath = System.IO.Path.GetTempPath();
On Windows Vista and 7, this method will return the following path:
C:\Users\UserName\AppData\Local\Temp\
Popularity: 2% [?]
When you download XML text from the Web, you may find “garbage characters” in the start of your XML string. For example, I encountered this result when I downloaded an XML string using WebClient.DownloadString method:
<Root><Item>Hello, World</Item></Root>
What you are likely seeing is a Byte Order Mark (BOM), which is a Unicode character that indicates the endian-ness (byte order) of a text file or stream. The BOM is optional and will appear at the start of the text stream, if at all. The BOM may also indicate in which of the several Unicode representations the text is encoded.
Popularity: 2% [?]
It’s easy to convert a byte array to a string. For an ASCII string, use the Encoding.ASCII.GetString static method:
byte[] buffer = new byte[10]; // todo: populate the buffer with string data string s = Encoding.ASCII.GetString( buffer );
Popularity: 3% [?]
It’s easy to convert a string to a byte array. For an ASCII string, use the Encoding.ASCII.GetBytes static method:
string s = "Test String"; byte[] byteArray = Encoding.ASCII.GetBytes( s );
Popularity: 3% [?]
It’s easy to read a file into a byte array. Just use the File.ReadAllBytes static method. This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file.
string filePath = @"C:\test.doc"; byte[] byteArray = File.ReadAllBytes( filePath );
Popularity: 3% [?]