I’ve just put up the first (of many) planned utilities on Developer Fusion – a conversion tool for automatically translating C# code into its VB.NET equivalent.
http://www.developerfusion.com/utilities/convertcsharptovb.aspx
Feel free to take a look, and let me know if you find any problems. The credit is 99.99% due to the guys behind #develop. I’ve simply made this tiny bit of their great application available online, plus added the ability to convert “bits” of classes or methods rather than just whole ones.
12 replies on “Automatically Convert C# code to VB.NET”
So will you be making the source available for this…SharpDevelop being GPL and all 😉
Sorry…just read the page…you will be, well done! Anyway, any chance of an opposite version – VB.NET – C#?
Scott – the source code is available to anyone who asks, and I”ll be making it publicly available when I get the chance.
Markus has just pointed me in the direction of their latest build, which includes a parser for the reverse process – so I”ll try to get this up later in the week!
anything out there to convert from VB.NET into C#?
thanks..
I”ll post on my blog again when the VB.NET to C# converter is up 🙂
James C, is the source code still available to anyone who asks?
If so, could you email me a copy? [email protected]
Wow….pretty nice and useful utility ! Good work.
Sonu
James C, is the source code still available to anyone who asks?
If so, could you email me a copy? [email protected]
Hi,
I”ve got a c# client application I”d like to
convert to VB. This is not a web application.
Will your application be able to convert this?
Regards,
Jim
Doesn”t work properly…..
void Application_BeginRequest (Object sender, EventArgs e)
{
//
// TODO: Convert a path of the form
// …/quotes/page1.aspx into a path of the form
// …/rewritepath.aspx?id=1
//
HttpContext context = HttpContext.Current;
string oldpath = context.Request.Path.ToLower ();
string token = "/quotes/page";
int i = oldpath.IndexOf (token);
int len = token.Length;
if (i != -1) {
int j = oldpath.IndexOf (".aspx");
if (j != -1) {
string id =
oldpath.Substring (i + len, j – (i + len));
string newpath =
oldpath.Replace (token + id + ".aspx",
"/rewritepath.aspx?id=" + id);
context.RewritePath (newpath);
}
}
}
Hi.
This could make things a lot easier for me. My boss wants me to rewrite my code in VB.NET and this would be a life saver.
Any chance I could get the code ([email protected])?
Thanks.
Juan