Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

How to tell vb or vb.net?

How do you tell if it is vb or vb.net?'

I was given an vb app to take a look.
So I was thinking it was vb application but it looks like someone opened it in the vs2010 and converted it.

The VS2010 doesn't have the vb to vb.net converter, VS2008 does.

It looks like it is used the framework 2.0 and don't see the .frm file you see in the vb6.

I see importing visualbasic line.

What else can I check to see if it is still in vb or vb.net?
0
dkim18
Asked:
dkim18
  • 3
  • 3
  • 2
  • +1
3 Solutions
 
YZlatCommented:
1) In VB 6 you would see variant type while there is no such type in VB.NET

2) In VB 6 errors are handled with On Error statement, while VB.NET uses Try...Catch blocks

3) IN VB.NET libraries are imported with a statement "Imports" and it is found on top of the file

4) To close a form, VB 6 uses "Unload Form1" method and VB.NET uses "Me.Close()" or "Form1.Close"


just to name a few
0
 
Martin LissRetired ProgrammerCommented:
If the project files contain a .VBP file then it's VB6 and it it doesn't then it's VB.Net.
0
 
dkim18Author Commented:
OK. Thanks

It is in VB.NET.
It looks like it got converted from VB to VB.NET using VS2010 or something.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Martin LissRetired ProgrammerCommented:
Is there anything more we can do for you here?
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
Be careful of what was said, there are a lot of wrong things there, and the way to know is very simple.

Good programming practice in VB.NET does not use On Error GoTo, but when converting a classic VB application to .NET, those instructions stay in the code because they cannot be converted to the new concept of a Try...Catch. The Imports statement does not have to be there, it is an option to shorten the code. The presence of a Close method means nothing, because many programmers coded a Close method in their VB6 applications.

Classic VB application were had .frm, .bas and .vbp files (and sometimes .csl) that are removed or renamed to .vb files when converting.

VB.NET applications have .vb and .vbproj files that did not exist in classic VB.

So, if you have .vb and .vbproj files in the source code directory, you are in VB.NET. If you have .frm and .bas files, you are in classic VB.
0
 
Martin LissRetired ProgrammerCommented:
@JamesBurger: I don't really disagree with what you said but I want to point out that while your "If you have .frm and .bas files, you are in classic VB" statement is true, but you don't have to have either in a VB6 project.
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
Right, it was not stated properly and completely. If you have either .vbp, .frm, .bas or .cls in the directory, you are in a VB6 application. It could also have a .asp (but not .aspx) it if it a web application.
0
 
YZlatCommented:
JamesBurger, no one said all of the above HAVE TO be there, I just listed those as some signs that should help determine whether the author is dealing with VB or VB.NET

I wonder, when people will evolve enough to give their own answers instead of critsizing answers given by others...
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
@YZlat

I am sorry if I hurted you, this was not my intention.

Programming requires rigor. People who ask questions here are often beginners who need precise answers otherwise they can end up all mixed up in their programming work and environment. When some informations can be misleading, I think that it is important to make them aware of those little details that can make things confusing.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now