473,408 Members | 2,113 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,408 software developers and data experts.

GetFileVersionInfo

I want to be able to display the attributes of a jpg file using the
fileversioninfo class.

I have tried the following code below but it doesn't work, where am i going
wrong? does it need special permissions?

FileVersionInfo FileProperties =
FileVersionInfo.GetVersionInfo(@"C:\test.txt");

Console.Write(FileProperties.FileDescription + '\n');

Console.Write(FileProperties.FileVersion + '\n');

Console.Write(FileProperties.InternalName + '\n');

Console.Write(FileProperties.OriginalFilename + '\n');

Console.Write(FileProperties.ProductName + '\n');

Console.Write(FileProperties.ProductVersion + '\n');

Console.Write(FileProperties.Language + '\n');
Jul 21 '05 #1
2 3058
What's the error?

--
Klaus H. Probst, MVP
http://www.vbbox.com/
"Tyrone" <ty****@tasc.co.nz> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I want to be able to display the attributes of a jpg file using the
fileversioninfo class.

I have tried the following code below but it doesn't work, where am i going wrong? does it need special permissions?

FileVersionInfo FileProperties =
FileVersionInfo.GetVersionInfo(@"C:\test.txt");

Console.Write(FileProperties.FileDescription + '\n');

Console.Write(FileProperties.FileVersion + '\n');

Console.Write(FileProperties.InternalName + '\n');

Console.Write(FileProperties.OriginalFilename + '\n');

Console.Write(FileProperties.ProductName + '\n');

Console.Write(FileProperties.ProductVersion + '\n');

Console.Write(FileProperties.Language + '\n');

Jul 21 '05 #2
By default text files do not have version info properties try a dll or exe
Jul 21 '05 #3

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

Similar topics

0
by: Fabster | last post by:
Below is a code part I got somewhere and works fine for retrieving a version from a single file. Now I want to retrieve all .dll, .ocx and ..exe file versions from my harddisk in all directory's. I...
1
by: RWC | last post by:
Hi Folks, I'm looking for a way to determine if the client machine has access installed and if so, what version. The reason I need this is to determine (programatically) if the Access Runtime...
3
by: Werner Merkl | last post by:
Hi, Python is really great, for small to big programs. For my colleagues and some circumstances I sometimes need to "compile" a script using py2exe. Cause I use Windows, I like to use the...
1
by: xytho33 | last post by:
I need to be able to programatically get the version info from a windows DLL preferably in the same format as what is displayed in the properties tab. I was overjoyed to find Mark Hammond's...
2
by: xytho33 | last post by:
I need to be able to programatically get the version info from a windows DLL preferably in the same format as what is displayed in the properties tab. I was overjoyed to find Mark Hammond's...
2
by: L. Shestov | last post by:
I need to be able to programatically get the version info from a windows DLL preferably in the same format as what is displayed in the properties tab. I was overjoyed to find Mark Hammond's...
1
by: Return info | last post by:
Hi, I can't get the VerQueryValue function to work for the life of me (it's returning 0, which means it failed, and I have NO IDEA why!) All I'm trying to do is get (and print) the file version...
2
by: Tyrone | last post by:
I want to be able to display the attributes of a jpg file using the fileversioninfo class. I have tried the following code below but it doesn't work, where am i going wrong? does it need special...
30
by: jeremygetsmail | last post by:
I've got an adp (Metrix.adp) with a reference to another adp (InteractSQL.adp). InteractSQL sits on a server, and is refered to by all of the clients (Metrix), which sit on the client machines...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.