473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Retrieving Product Versions

Hi.

I need to retrieve the product version of a specific file from within my
VB.Net application so that I can determine if the application has the correct
version from a third party supplier.

I have done it in other languages just not .Net so I know it is possible.
But don't know how to do it in VB.Net.

Thanks In Advance,
Chris Braun
Nov 21 '05 #1
8 1151
Chris,

There are more possibilities two of them

\\\
MessageBox.Show( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString())
'or
MessageBox.Show( _
System.Windows.Forms.Application.ProductVersion)
///

I hope this helps?

Cor
Nov 21 '05 #2
Use the FileInfo class

"Chris Braun" wrote:
Hi.

I need to retrieve the product version of a specific file from within my
VB.Net application so that I can determine if the application has the correct
version from a third party supplier.

I have done it in other languages just not .Net so I know it is possible.
But don't know how to do it in VB.Net.

Thanks In Advance,
Chris Braun

Nov 21 '05 #3
Cor

It appears that these both methods require the 'file' in question to be part
of the application. I guess I should have been more specific. What I really
need to find out is what version of MS SQL Server the user is currently?.

I tried using the windows reqistry BUT if the user installed MSDE their
version number is 8.00.194 even after they have installed service pack 3
(8.00.760) so I can't use the Windows Registry.

Thanks in Advance,
Chris Braun

"Cor Ligthert" wrote:
Chris,

There are more possibilities two of them

\\\
MessageBox.Show( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString())
'or
MessageBox.Show( _
System.Windows.Forms.Application.ProductVersion)
///

I hope this helps?

Cor

Nov 21 '05 #4
Is this what you are needing?

Dim exefile As String = "C:\Program Files\Microsoft Office\Office\Winword.exe"
Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo(exefile)

Console.WriteLine("ProductName: {0}", fvi.ProductName)
Console.WriteLine("ProductVersion: {0}", fvi.ProductVersion)
Console.WriteLine("CompanyName: {0}", fvi.CompanyName)
Console.WriteLine("FileVersion: {0}", fvi.FileVersion)
Console.WriteLine("FileDescription: {0}", fvi.FileDescription)
Console.WriteLine("OriginalFilename: {0}", fvi.OriginalFilename)
Console.WriteLine("LegalCopyright: {0}", fvi.LegalCopyright)
Console.WriteLine("LegalTrademarks: {0}", fvi.LegalTrademarks)
Console.WriteLine("Comments: {0}", fvi.Comments)
Console.WriteLine("InternalName: {0}", fvi.InternalName)

Just replace WinWord.exe with the file you need the information on.
"Crouchie1998" wrote:
Use the FileInfo class

"Chris Braun" wrote:
Hi.

I need to retrieve the product version of a specific file from within my
VB.Net application so that I can determine if the application has the correct
version from a third party supplier.

I have done it in other languages just not .Net so I know it is possible.
But don't know how to do it in VB.Net.

Thanks In Advance,
Chris Braun

Nov 21 '05 #5
Chris,

Because the SQL server should not be reachable as file, your solution will
in my opinion fail forever.
I don't know the answer for you, however to get the answer it is more simple
when you ask it yourself in this newsgroup.

Adonet
news://msnews.microsoft.com/microsof...amework.adonet

Web interface:
http://communities2.microsoft.com/co...amework.adonet
When they don't know it there it will be hard to find.

(You can try it as well crossposted to the newsgroup General, about this
does by instance Nick Malick often know a lot and he is active as well in
most, however mostly in General).

Cor
Nov 21 '05 #6
Chris,
In addition to the other comments:

To find out specifically the version of SQL Server you are using, consider
using "SELECT @@VERSION".

I do not have the link handy on what version numbers represent which service
packs...

You can use a SqlCommand to execute the above, something like:

Dim connection As New SqlClient.SqlConnection("integrated
security=SSPI;data source=.;")
connection.Open()
Try
Dim command As New SqlClient.SqlCommand("Select @@version",
connection)
Dim version As String = DirectCast(command.ExecuteScalar(),
String)
Debug.WriteLine(version, "SQL Version")
Finally
connection.Close()
End Try

Alternatively you could use the xp_msver extended store procedure to return
specific values (rather then attempt to parse the string returned from
@@version). See the BOL for information on xp_msver.

Hope this helps
Jay

"Chris Braun" <Ch********@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.com...
Cor

It appears that these both methods require the 'file' in question to be
part
of the application. I guess I should have been more specific. What I
really
need to find out is what version of MS SQL Server the user is currently?.

I tried using the windows reqistry BUT if the user installed MSDE their
version number is 8.00.194 even after they have installed service pack 3
(8.00.760) so I can't use the Windows Registry.

Thanks in Advance,
Chris Braun

"Cor Ligthert" wrote:
Chris,

There are more possibilities two of them

\\\
MessageBox.Show( _
System.Reflection.Assembly.GetExecutingAssembly( _
).GetName().Version.ToString())
'or
MessageBox.Show( _
System.Windows.Forms.Application.ProductVersion)
///

I hope this helps?

Cor

Nov 21 '05 #7
Jay,

I was looking for @@Version because MSDN has now nice SQL pages, and then I
found this.

http://support.microsoft.com/default...b;en-us;321185

I hope this helps

Cor
Nov 21 '05 #8
Crouchie1998

Thanks this is what I was looking for.

Thanks,
Chris Braun

"Crouchie1998" wrote:
Is this what you are needing?

Dim exefile As String = "C:\Program Files\Microsoft Office\Office\Winword.exe"
Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo(exefile)

Console.WriteLine("ProductName: {0}", fvi.ProductName)
Console.WriteLine("ProductVersion: {0}", fvi.ProductVersion)
Console.WriteLine("CompanyName: {0}", fvi.CompanyName)
Console.WriteLine("FileVersion: {0}", fvi.FileVersion)
Console.WriteLine("FileDescription: {0}", fvi.FileDescription)
Console.WriteLine("OriginalFilename: {0}", fvi.OriginalFilename)
Console.WriteLine("LegalCopyright: {0}", fvi.LegalCopyright)
Console.WriteLine("LegalTrademarks: {0}", fvi.LegalTrademarks)
Console.WriteLine("Comments: {0}", fvi.Comments)
Console.WriteLine("InternalName: {0}", fvi.InternalName)

Just replace WinWord.exe with the file you need the information on.
"Crouchie1998" wrote:
Use the FileInfo class

"Chris Braun" wrote:
Hi.

I need to retrieve the product version of a specific file from within my
VB.Net application so that I can determine if the application has the correct
version from a third party supplier.

I have done it in other languages just not .Net so I know it is possible.
But don't know how to do it in VB.Net.

Thanks In Advance,
Chris Braun

Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dtSearch | last post by:
Press Contact: Belinda Banks S&S Public Relations (212) 946-2823 Belinda@sspr.com Announcing New dtSearch® Product Line Version Release Adds Broader Spider Capabilities to dtSearch Desktop,...
0
by: dtsearch | last post by:
Announcing dtSearch® Product Line Release With New Terabyte Indexer New Version Can Index Over a Terabyte of Text in a Single Index, With Indexed Search Time Typically Under a Second BETHESDA,...
6
by: Corinne | last post by:
Over the last year I have designed a database to store information in the school I work in. It has now replaced the commercially produced programme we were using. I should like to market this and...
2
by: blackg | last post by:
Here is the whole story. I have a table in my db call Products. columns are: ProductID, Product, ProductImage. Now in the Product.aspx page I want the visitor to be able to upload the Image of...
3
by: Ramon | last post by:
Hello there, I'm quite new to OOP in PHP. Unfortunately, I'm forced to work with PHP4, because my website is still hosted with this version. I've made two classes (see below): "Product" and...
3
by: Susanne Klemm | last post by:
Hello! I use a procedure to insert a new row into a table with an identity column. The procedure has an output parameter which gives me the inserted identity value. This worked well for a long...
5
by: Dmitry Bond. | last post by:
Hello. Our product works fine on all 7.x and 8.x DB2 versions. But stops to work on DB2 v9.1. The main problem is - duplicate primary key (sqlcode=-803) happens when inserting records in...
4
by: =?Utf-8?B?QXZvY2V0?= | last post by:
I recently bought a new computer and want to install my VB.net 2003, but I cannot seem to find my product key anymore. Yes I have legal version with all CDs and blue box with all the information...
0
by: David Troxell - Encourager Software | last post by:
Product Scope 7 (http://www.encouragersoftware.com/) and Profile Exchanges enhanced with SetupCast publishing methods NOTE: If you are a software author, releasing commercial and/or shareware...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.