Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Getting Version Number From "Properties Of Project" Dialog


Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2009, 03:50 AM
prateepg prateepg is offline
Newcomer
 
Join Date: May 2009
Posts: 19
Default Getting Version Number From "Properties Of Project" Dialog


Hi,

like the title already says I would like to know if there's a way to get the Version number of my VB Project as shown in the "Properties of Project" into a Constant/Variable?

File->Make projectname .exe ->Options->Properties of Project

You know that thing with the "Auto Increment" Option that looks like:

1.0.00

Right now I do manually :

VB Code:
Public Const Version As String = "Vers. 1.030"


Any Constant/Variable VB already put this value into automatically?
Reply With Quote
  #2  
Old 07-16-2009, 07:53 AM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

The version can be returned using four different calls

VerNo = Application.Version - Returns full version information
VerNo = App.Major - Returns Major version (first number)
VerNo = App.Major - Returns Minor version (second number)
VerNo = App.Revision - Returns Revision Number (last number)
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
  #3  
Old 07-16-2009, 08:11 PM
vb5prgrmr vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,087
Default

Quote:
Originally Posted by Roger_Wgnr View Post
The version can be returned using four different calls

VerNo = Application.Version - Returns full version information
VerNo = App.Major - Returns Major version (first number)
VerNo = App.Major - Returns Minor version (second number)
VerNo = App.Revision - Returns Revision Number (last number)
In VB 6.0 there is no Application.Version

Also

3rd line down should be App.Minor

SO...
Code:
Dim VerNo As String
VerNo = App.Major & "." & App.Minor & "." & App.Revision
MsgBox VerNo

Good Luck
Reply With Quote
  #4  
Old 07-16-2009, 08:39 PM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

Quote:
Originally Posted by vb5prgrmr View Post
In VB 6.0 there is no Application.Version

Also

3rd line down should be App.Minor

SO...
Your right A bit tired when I posted and checked one of my test apps. Turned out I had an Excel instance in the app and Application.Version is related to the Excel Application....My Bad the other was just a typo.
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
  #5  
Old 07-17-2009, 05:15 AM
prateepg prateepg is offline
Newcomer
 
Join Date: May 2009
Posts: 19
Default

thanks.. guys... It works fine....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->