473,800 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1780
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
"Kondapanai du" <kondapanaidu > wrote in message
news:eb******** ******@TK2MSFTN GP14.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.Diagnost ics
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 myFileVersionIn fo =
FileVersionInfo .GetVersionInfo ("C:\\WINNT\\No tepad.exe");

// Print the file name and version number.
Console.Writeli ne("File: " + myFileVersionIn fo.FileDescript ion +
'\n' +
"Version number: " + myFileVersionIn fo.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 GetFileVersionI nfo
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

"Kondapanai du" <kondapanaidu > wrote in message
news:eb******** ******@TK2MSFTN GP14.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.Diagnost ics.FileVersion Info 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
1463
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 versions need to be removed before the upgrade, so I deleted the py2app directory and downloaded and installed it separately, but got the same result. How do I get it to find this boot_app.py file? Thanks, Bob
0
3454
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 problem is I get the following two errors everytime I try to create the application: Error 1: The web was created successfully, but an error occured trying to configure the application root of this web.Web projects may not operate correctly...
0
1025
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 problem is I get the following two errors everytime I try to create the application: Error 1: The web was created successfully, but an error occured trying to configure the application root of this web.Web projects may not operate correctly...
1
3544
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 don't compile anything non trivial often. ironfroggy:~/Desktop/pyOpenSSL-0.6 ironfroggy$ python setup.py build running build running build_py running build_ext building 'OpenSSL.crypto' extension
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.