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.

Comments

12 responses to “Automatically Convert C# code to VB.NET”

  1. Scott Galloway avatar

    So will you be making the source available for this…SharpDevelop being GPL and all 😉

  2. Scott Galloway avatar

    Sorry…just read the page…you will be, well done! Anyway, any chance of an opposite version – VB.NET – C#?

  3. James Crowley avatar

    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!

  4. SBC avatar

    anything out there to convert from VB.NET into C#?

    thanks..

  5. James Crowley avatar

    I”ll post on my blog again when the VB.NET to C# converter is up 🙂

  6. http:// avatar
    http://

    James C, is the source code still available to anyone who asks?

    If so, could you email me a copy? [email protected]

  7. Sonu Kapoor avatar

    Wow….pretty nice and useful utility ! Good work.

    Sonu

  8. http:// avatar
    http://

    James C, is the source code still available to anyone who asks?

    If so, could you email me a copy? [email protected]

  9. http:// avatar
    http://

    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

  10. http:// avatar
    http://

    Doesn”t work properly…..

  11. df avatar

    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);

    }

    }

    }

  12. http:// avatar
    http://

    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

Leave a Reply to James Crowley Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.