Problem solve Get help with specific problems with your technologies, process and projects.

Converting a VB Windows application to VB .NET Web application

Here our experts address how to converti a VB Windows application to a VB .NET Web application.

1. I need some advice and/or resources on how to convert a VB windows application to VB.NET Web application. Is there any conversion tool to do this, or I need to recreate a new version in VB.NET? 2. Currently I also try to convert my VB Windows application to VB.NET by using the conversion tool in Visual Studio.NET 2003. After the conversion, still need a lot of manual change such as:

- load(frmTemp) --> Dim frmTemp As new frmTemp

- txtBox = "Hello" --> txtBox.Text = "Hello"

Is there any way or setup in the conversion tool to help me auto-convert this?

1) If you created your application with the proper separation of layers (i.e. a library for the business logic, another for UI stuff, another (optional?) for DB access), you can reuse as-is all except for the UI one. You will need to recreate all screens, unfortunately. There's no tool that I'm aware of.

2) Now the problem is clearer. It seems that what you're doing is upgrading from VB6. If you have a well defined naming convention for your controls, you could use a global search and replace to append the .Text property access in the second case. The first case can also be solved with a global search and replace using regular expressions. You actually have to not only create a new variable for the form, but you also have to call Show on it. Here's how to configure the Search & Replace dialog:

Find what: Load({[^)]*})
Replace with: Dim temp As New 1ntttemp.Show()
Use: Regular Expressions

If you have the following in the original source:

A fter the replace you'll have:
Dim temp As New frmTemp

Key points: the curly braces inside the expression ({[^)]*}) captures the value so you can refer to it from the replacement string using 1 (or 2, 3, etc for subsequent capture groups). The expression in this case captures any string that is not the closing parenthesis, after the initial opening parenthesis, which must be escaped using ). The n is used to output a new line, and t for a Tab.

Dig Deeper on VB 6 to VB .NET Migration