473,395 Members | 1,571 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,395 software developers and data experts.

How to find file versions using C#

Hi,

How to find the File Versions using C#.

I am using .NET1.1, WIN2K Professional.

Thanks in advance...

regards


*** Sent via Developersdex http://www.developersdex.com ***
Mar 27 '06 #1
4 1768
Hello,

The properties of the File Object should allow you to do this (System.IO).
Unfortunalty i am not in front of my own computer at hte moment so i cant
give an example.

Regards
Scott Blood
C# Developer
"Kondapanaidu" <kondapanaidu> wrote in message
news:eb**************@TK2MSFTNGP14.phx.gbl...
Hi,

How to find the File Versions using C#.

I am using .NET1.1, WIN2K Professional.

Thanks in advance...

regards


*** Sent via Developersdex http://www.developersdex.com ***

Mar 27 '06 #2
Hi,

Use the FileVersionInfo class. It is located in the System.Diagnostics
namespace. It's static method GetVersionInfo can be used to elicit this
information.

eg. of use :
------------------------------------
public void GetFileVersion() {
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo =
FileVersionInfo.GetVersionInfo("C:\\WINNT\\Notepad .exe");

// Print the file name and version number.
Console.Writeline("File: " + myFileVersionInfo.FileDescription +
'\n' +
"Version number: " + myFileVersionInfo.FileVersion);
}
------------------------------------
Regards,

Cerebrus

Mar 27 '06 #3
Hi,
This feature is not implemented in the framework (at least in 1.1) , you
will have to P/invoke
go to pinvoke.net and search for GetFileVersionInfo
Ok, I found this link in google:
http://groups.google.com/group/micro...343beda313faff

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kondapanaidu" <kondapanaidu> wrote in message
news:eb**************@TK2MSFTNGP14.phx.gbl...
Hi,

How to find the File Versions using C#.

I am using .NET1.1, WIN2K Professional.

Thanks in advance...

regards


*** Sent via Developersdex http://www.developersdex.com ***

Mar 27 '06 #4
>This feature is not implemented in the framework (at least in 1.1) , you
will have to P/invoke


System.Diagnostics.FileVersionInfo has been there since v1.0 IIRC.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 27 '06 #5

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

Similar topics

0
by: Bob Swerdlow | last post by:
I'm trying to move my application from bundlebuilder to py2app. I upgraded to PyObjC 1.2, which include py2app 1.7, but I got the following error. I saw a note on the py2app site that earlier...
0
by: Amol Shambharkar | last post by:
Hello Everyone, I am hoping someone could help me out with this.I am using Visual Studio .NET 2003 to create a web application on a remote IIS 5.0 server using the File Share web access method.The...
0
by: Amol Shambharkar | last post by:
Hello Everyone, I am hoping someone could help me out with this.I am using Visual Studio .NET 2003 to create a web application on a remote IIS 5.0 server using the File Share web access method.The...
1
by: Calvin Spealman | last post by:
I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing with Python.h trying to include and failing to find any of the shared libraries. I can't figure this one out because i just...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.