Click here to Skip to main content
15,886,786 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Basically I need to read the product version of a file in FTP server directory.
But this function will be no use for me, if the function downloads the file in background and then reads the info, basically if this function only read the product info directly from the FTP directory without any kind of first downloading the file then reading the version, only then i can use it.

So can you explain few steps if you know, how this function really works, since I dont know how to see the code of the function.

simple code i use is this:
C#
var FileVer = System.Diagnostics.FileVersionInfo.GetVersionInfo(ftpListItem.FullName);
string x = FileVer.ProductVersion;
Posted
Comments
Sergey Alexandrovich Kryukov 20-Mar-15 15:56pm    
What makes you thinking that this particular file has version information at all?
—SA
SrgjanX 20-Mar-15 17:29pm    
@Sergey well even if it doesnt, it will return empty string so doesnt matter...
and i know what am doing .. just if you know answer my question about getting the product version from a file on FTP server not locally on a local disk drive..

1 solution

Practically, if you read any data from any file, you need to load that data in the memory. So it is quite indifferent what storage is benieth.
If you want to know how it really works, read the code: http://referencesource.microsoft.com/#System/services/monitoring/system/diagnosticts/FileVersionInfo.cs[^].

In general, version informations are first from the embedded resources, which are stored at the end of the file. So, first you will need the headers of the file to be able to calculate the position of the resources. Than you can skip to that positions - if you can. As not all FTP servers implement this feature.

Anyway, you will need to download at least some portions of the file...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900