Can we indicate the version of a file when creating a file in C #?

I am creating a file using:

File.WriteAllText(FILEPATHNAME, "SOME VALUE");

When creating a file, is it possible to programmatically indicate the version? So, if someone should use the FileVersionInfo object, will he get the specified version?

+5
source share
4 answers

No, there is no way to write a version of a file this way, and I don’t know, to be honest.

Possible option:

Write the version of the file to the file itself in some formatted data.

The most common approach that I see is writing to the beginning of the file or to the first line of the file. Thus, you can quickly access this information and solve any process with reading or not.

+2
source

FileVersionInfo - , . , . ( FileVersionInfo)

+4

, . - , , .

. FileVersionInfo Class.

, , .

+3

, , " NTFS" (ADS).

, , gotchas.

+1

All Articles