Coder Social home page Coder Social logo

vbconverter's Introduction

Welcome!

The VB Converter analyses VB6 code and converts it to .NET 2.0 (C# or VB). It uses a modified implementation VBParser (of the wondeful work of Paul Vick) and CodeDom.

Feel free to download it, contribute and comment. For any other issues, please contact us: [email protected]

Migrated from Codeplex: https://vbconverter.codeplex.com/

Features

  • Convert part of Visual Basic 6 code to C# and VB .NET
  • Batch converter (Files)

Roadmap

  • Refactor the CodeWriter module.
  • Add more VB6 expressions (such as Print)

Examples

Methods (Visual Basic 6)

Public Sub Main()
    Dim name As String
    name = InputBox("Enter your name: ", "VB6 App")
    If name = "" Then
        MsgBox "You must enter your name !", vbCritical, "Error"
    Else
        MsgBox "Your name is: " & name, vbInformation, "Info"
    End If
End Sub

Methods (C#)

public void Main() {
    string name;
    name = Interaction.InputBox("Enter your name: ", "VB6 App");
    if ((name == "")) {
        Interaction.MsgBox("You must enter your name !", Constants.vbCritical, "Error");
    }
    else {
        Interaction.MsgBox(("Your name is: " + name), Constants.vbInformation, "Info");
    }
}

Project Structure

  • VBConverter.CodeParser: Responsible for parsing the VB code into a tree.
  • VBConverter.CodeWriter: Responsible for converting the tree structure to .NET.
  • VBConverter.UI: User interface (Windows Forms) responsible for testing the convertion.

Examples

Declarations (Visual Basic 6)

Dim name As String
Private list(5) As Integer
Protected rs As ADODB.Recordset
Friend birthDate As Date
Public Const CUSTOMER As Integer = &H16

Declarations (C#)

string name;
private short[] list = new short[6];
protected ADODB.Recordset rs;
internal DateTime birthDate;
public const short CUSTOMER = 22;

Methods (Visual Basic 6)

Private Function Sum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
    Sum = num1 + num2
End Function
Sub Load()
    db.Load
End Sub

Methods (C#)

private short Sum(short num1, short num2) {
    short _result_Sum = default(short);
    _result_Sum = (num1 + num2);
    return _result_Sum;
}
private void Load() {
    db.Load();
}

Properties (Visual Basic 6)

Public Property Get Name() As String
    Name = m_Name
End Function
Public Property Let Name(newName As String)
    m_Name = newName
End Function

Properties (C#)

public string Name {
    get {
        return m_Name;
    }
    set {
        m_Name = value;
    }
}

Events (Visual Basic 6)

Friend Event OnLoad(ByVal Status As Integer)

Properties (C#)

internal event OnLoadHandler OnLoad;
internal delegate void OnLoadHandler(short Status);

vbconverter's People

Contributors

wwdenis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.