Automatically Convert C# code to VB.NET

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.

Published 14 April 2004 06:30 PM by James Crowley

Comments

# Scott Galloway said on 14 April, 2004 03:27 PM
So will you be making the source available for this...SharpDevelop being GPL and all ;-)
# Scott Galloway said on 14 April, 2004 03:28 PM
Sorry...just read the page...you will be, well done! Anyway, any chance of an opposite version - VB.NET - C#?
# James Crowley said on 14 April, 2004 03:34 PM
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!
# SBC said on 14 April, 2004 08:52 PM
anything out there to convert from VB.NET into C#?
thanks..
# James Crowley said on 15 April, 2004 05:14 AM
I'll post on my blog again when the VB.NET to C# converter is up :)
# TrackBack said on 17 April, 2004 06:57 AM
# Raistlin said on 24 April, 2004 06:17 PM
James C, is the source code still available to anyone who asks?

If so, could you email me a copy? raistlin@videotron.ca
# Sonu Kapoor said on 02 May, 2004 11:24 AM
Wow....pretty nice and useful utility ! Good work.

Sonu
# Mike said on 02 May, 2004 02:58 PM
James C, is the source code still available to anyone who asks?

If so, could you email me a copy? mo@djj.com
# Jim Beauchamp said on 10 May, 2004 01:48 PM
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
# giovanni said on 13 May, 2004 10:27 AM
Doesn't work properly.....
# df said on 20 May, 2004 07:54 PM
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);

}

}

}

# Juan said on 20 July, 2004 09:11 AM
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 (juangomez@engineer.com)?

Thanks.

Juan

Leave a Comment

(required) 
(required) 
(optional)
(required)