While I really love the online VB.NET to C# and C# to VB.NET code converters provided by developerFusion, I have also found the open source SharpDevelop application to be a very good tool for converting .NET code from one flavor to another. It is especially good at converting whole projects or larger amounts of code. I think it is worthy a post:
http://www.icsharpcode.net/OpenSource/SD/
Code Conversion Features:
http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourCodeConversion.aspx
Code Conversion is one very small part of SharpDevelop. The rest is worth a look too!
This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.
Thursday, June 25, 2009
Friday, June 5, 2009
Converting a Byte Array to a String in VB.NET
Here is one way to convert a byte array to a String in VB.NET:
Dim bArray() As Byte = {65, 66, 67, 68, 69}
Dim str As String
str = System.Text.Encoding.ASCII.GetString(bArray)
More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:
http://www.chilkatsoft.com/faq/DotNetStrToBytes.html
Dim bArray() As Byte = {65, 66, 67, 68, 69}
Dim str As String
str = System.Text.Encoding.ASCII.GetString(bArray)
More examples of converting Byte Arrays to Strings and vice versa in VB.NET and C# can be found here:
http://www.chilkatsoft.com/faq/DotNetStrToBytes.html
Labels:
Byte Array,
String
Getting Application Path for a Console App
In a previous post, I gave examples of getting the Application Path for a Windows Form app and a Windows Mobile app. Getting the Application Path for a Console app is similar to getting one for the Windows Mobile app:
Dim appPath As String = _
System.IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim appPath As String = _
System.IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Labels:
AppStartupPath
Subscribe to:
Posts (Atom)