using System; using System.IO; using System.Runtime.CompilerServices; using System.Text; namespace System.Diagnostics { /// Provides version information for a physical file on disk. /// 2 // Token: 0x020000E3 RID: 227 public sealed class FileVersionInfo { // Token: 0x06000790 RID: 1936 RVA: 0x000144F0 File Offset: 0x000126F0 private FileVersionInfo() { this.comments = null; this.companyname = null; this.filedescription = null; this.filename = null; this.fileversion = null; this.internalname = null; this.language = null; this.legalcopyright = null; this.legaltrademarks = null; this.originalfilename = null; this.privatebuild = null; this.productname = null; this.productversion = null; this.specialbuild = null; this.isdebug = false; this.ispatched = false; this.isprerelease = false; this.isprivatebuild = false; this.isspecialbuild = false; this.filemajorpart = 0; this.fileminorpart = 0; this.filebuildpart = 0; this.fileprivatepart = 0; this.productmajorpart = 0; this.productminorpart = 0; this.productbuildpart = 0; this.productprivatepart = 0; } /// Gets the comments associated with the file. /// The comments associated with the file or null if the file did not contain version information. /// 2 // Token: 0x170001C8 RID: 456 // (get) Token: 0x06000791 RID: 1937 RVA: 0x000145C0 File Offset: 0x000127C0 public string Comments { get { return this.comments; } } /// Gets the name of the company that produced the file. /// The name of the company that produced the file or null if the file did not contain version information. /// 2 // Token: 0x170001C9 RID: 457 // (get) Token: 0x06000792 RID: 1938 RVA: 0x000145C8 File Offset: 0x000127C8 public string CompanyName { get { return this.companyname; } } /// Gets the build number of the file. /// A value representing the build number of the file or null if the file did not contain version information. /// 2 // Token: 0x170001CA RID: 458 // (get) Token: 0x06000793 RID: 1939 RVA: 0x000145D0 File Offset: 0x000127D0 public int FileBuildPart { get { return this.filebuildpart; } } /// Gets the description of the file. /// The description of the file or null if the file did not contain version information. /// 2 // Token: 0x170001CB RID: 459 // (get) Token: 0x06000794 RID: 1940 RVA: 0x000145D8 File Offset: 0x000127D8 public string FileDescription { get { return this.filedescription; } } /// Gets the major part of the version number. /// A value representing the major part of the version number or 0 (zero) if the file did not contain version information. /// 2 // Token: 0x170001CC RID: 460 // (get) Token: 0x06000795 RID: 1941 RVA: 0x000145E0 File Offset: 0x000127E0 public int FileMajorPart { get { return this.filemajorpart; } } /// Gets the minor part of the version number of the file. /// A value representing the minor part of the version number of the file or 0 (zero) if the file did not contain version information. /// 2 // Token: 0x170001CD RID: 461 // (get) Token: 0x06000796 RID: 1942 RVA: 0x000145E8 File Offset: 0x000127E8 public int FileMinorPart { get { return this.fileminorpart; } } /// Gets the name of the file that this instance of describes. /// The name of the file described by this instance of . /// 2 // Token: 0x170001CE RID: 462 // (get) Token: 0x06000797 RID: 1943 RVA: 0x000145F0 File Offset: 0x000127F0 public string FileName { get { return this.filename; } } /// Gets the file private part number. /// A value representing the file private part number or null if the file did not contain version information. /// 2 // Token: 0x170001CF RID: 463 // (get) Token: 0x06000798 RID: 1944 RVA: 0x000145F8 File Offset: 0x000127F8 public int FilePrivatePart { get { return this.fileprivatepart; } } /// Gets the file version number. /// The version number of the file or null if the file did not contain version information. /// 2 // Token: 0x170001D0 RID: 464 // (get) Token: 0x06000799 RID: 1945 RVA: 0x00014600 File Offset: 0x00012800 public string FileVersion { get { return this.fileversion; } } /// Gets the internal name of the file, if one exists. /// The internal name of the file. If none exists, this property will contain the original name of the file without the extension. /// 2 // Token: 0x170001D1 RID: 465 // (get) Token: 0x0600079A RID: 1946 RVA: 0x00014608 File Offset: 0x00012808 public string InternalName { get { return this.internalname; } } /// Gets a value that specifies whether the file contains debugging information or is compiled with debugging features enabled. /// true if the file contains debugging information or is compiled with debugging features enabled; otherwise, false. /// 2 // Token: 0x170001D2 RID: 466 // (get) Token: 0x0600079B RID: 1947 RVA: 0x00014610 File Offset: 0x00012810 public bool IsDebug { get { return this.isdebug; } } /// Gets a value that specifies whether the file has been modified and is not identical to the original shipping file of the same version number. /// true if the file is patched; otherwise, false. /// 2 // Token: 0x170001D3 RID: 467 // (get) Token: 0x0600079C RID: 1948 RVA: 0x00014618 File Offset: 0x00012818 public bool IsPatched { get { return this.ispatched; } } /// Gets a value that specifies whether the file is a development version, rather than a commercially released product. /// true if the file is prerelease; otherwise, false. /// 2 // Token: 0x170001D4 RID: 468 // (get) Token: 0x0600079D RID: 1949 RVA: 0x00014620 File Offset: 0x00012820 public bool IsPreRelease { get { return this.isprerelease; } } /// Gets a value that specifies whether the file was built using standard release procedures. /// true if the file is a private build; false if the file was built using standard release procedures or if the file did not contain version information. /// 2 // Token: 0x170001D5 RID: 469 // (get) Token: 0x0600079E RID: 1950 RVA: 0x00014628 File Offset: 0x00012828 public bool IsPrivateBuild { get { return this.isprivatebuild; } } /// Gets a value that specifies whether the file is a special build. /// true if the file is a special build; otherwise, false. /// 2 // Token: 0x170001D6 RID: 470 // (get) Token: 0x0600079F RID: 1951 RVA: 0x00014630 File Offset: 0x00012830 public bool IsSpecialBuild { get { return this.isspecialbuild; } } /// Gets the default language string for the version info block. /// The description string for the Microsoft Language Identifier in the version resource or null if the file did not contain version information. /// 2 // Token: 0x170001D7 RID: 471 // (get) Token: 0x060007A0 RID: 1952 RVA: 0x00014638 File Offset: 0x00012838 public string Language { get { return this.language; } } /// Gets all copyright notices that apply to the specified file. /// The copyright notices that apply to the specified file. /// 2 // Token: 0x170001D8 RID: 472 // (get) Token: 0x060007A1 RID: 1953 RVA: 0x00014640 File Offset: 0x00012840 public string LegalCopyright { get { return this.legalcopyright; } } /// Gets the trademarks and registered trademarks that apply to the file. /// The trademarks and registered trademarks that apply to the file or null if the file did not contain version information. /// 2 // Token: 0x170001D9 RID: 473 // (get) Token: 0x060007A2 RID: 1954 RVA: 0x00014648 File Offset: 0x00012848 public string LegalTrademarks { get { return this.legaltrademarks; } } /// Gets the name the file was created with. /// The name the file was created with or null if the file did not contain version information. /// 2 // Token: 0x170001DA RID: 474 // (get) Token: 0x060007A3 RID: 1955 RVA: 0x00014650 File Offset: 0x00012850 public string OriginalFilename { get { return this.originalfilename; } } /// Gets information about a private version of the file. /// Information about a private version of the file or null if the file did not contain version information. /// 2 // Token: 0x170001DB RID: 475 // (get) Token: 0x060007A4 RID: 1956 RVA: 0x00014658 File Offset: 0x00012858 public string PrivateBuild { get { return this.privatebuild; } } /// Gets the build number of the product this file is associated with. /// A value representing the build number of the product this file is associated with or null if the file did not contain version information. /// 2 // Token: 0x170001DC RID: 476 // (get) Token: 0x060007A5 RID: 1957 RVA: 0x00014660 File Offset: 0x00012860 public int ProductBuildPart { get { return this.productbuildpart; } } /// Gets the major part of the version number for the product this file is associated with. /// A value representing the major part of the product version number or null if the file did not contain version information. /// 2 // Token: 0x170001DD RID: 477 // (get) Token: 0x060007A6 RID: 1958 RVA: 0x00014668 File Offset: 0x00012868 public int ProductMajorPart { get { return this.productmajorpart; } } /// Gets the minor part of the version number for the product the file is associated with. /// A value representing the minor part of the product version number or null if the file did not contain version information. /// 2 // Token: 0x170001DE RID: 478 // (get) Token: 0x060007A7 RID: 1959 RVA: 0x00014670 File Offset: 0x00012870 public int ProductMinorPart { get { return this.productminorpart; } } /// Gets the name of the product this file is distributed with. /// The name of the product this file is distributed with or null if the file did not contain version information. /// 2 // Token: 0x170001DF RID: 479 // (get) Token: 0x060007A8 RID: 1960 RVA: 0x00014678 File Offset: 0x00012878 public string ProductName { get { return this.productname; } } /// Gets the private part number of the product this file is associated with. /// A value representing the private part number of the product this file is associated with or null if the file did not contain version information. /// 2 // Token: 0x170001E0 RID: 480 // (get) Token: 0x060007A9 RID: 1961 RVA: 0x00014680 File Offset: 0x00012880 public int ProductPrivatePart { get { return this.productprivatepart; } } /// Gets the version of the product this file is distributed with. /// The version of the product this file is distributed with or null if the file did not contain version information. /// 2 // Token: 0x170001E1 RID: 481 // (get) Token: 0x060007AA RID: 1962 RVA: 0x00014688 File Offset: 0x00012888 public string ProductVersion { get { return this.productversion; } } /// Gets the special build information for the file. /// The special build information for the file or null if the file did not contain version information. /// 2 // Token: 0x170001E2 RID: 482 // (get) Token: 0x060007AB RID: 1963 RVA: 0x00014690 File Offset: 0x00012890 public string SpecialBuild { get { return this.specialbuild; } } // Token: 0x060007AC RID: 1964 [MethodImpl(MethodImplOptions.InternalCall)] private extern void GetVersionInfo_internal(string fileName); /// Returns a representing the version information associated with the specified file. /// A containing information about the file. If the file did not contain version information, the contains only the name of the file requested. /// The fully qualified path and name of the file to retrieve the version information for. /// The file specified cannot be found. /// 1 // Token: 0x060007AD RID: 1965 RVA: 0x00014698 File Offset: 0x00012898 public static FileVersionInfo GetVersionInfo(string fileName) { string fullPath = Path.GetFullPath(fileName); if (!File.Exists(fullPath)) { throw new FileNotFoundException(fileName); } FileVersionInfo fileVersionInfo = new FileVersionInfo(); fileVersionInfo.GetVersionInfo_internal(fileName); return fileVersionInfo; } // Token: 0x060007AE RID: 1966 RVA: 0x000146CC File Offset: 0x000128CC private static void AppendFormat(StringBuilder sb, string format, params object[] args) { sb.AppendFormat(format, args); } /// Returns a partial list of properties in the and their values. /// A list of the following properties in this class and their values: , , , , , , , , , , , ,.If the file did not contain version information, this list will contain only the name of the requested file. Boolean values will be false, and all other entries will be null. /// 2 // Token: 0x060007AF RID: 1967 RVA: 0x000146D8 File Offset: 0x000128D8 public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); FileVersionInfo.AppendFormat(stringBuilder, "File: {0}{1}", new object[] { this.FileName, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "InternalName: {0}{1}", new object[] { this.internalname, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "OriginalFilename: {0}{1}", new object[] { this.originalfilename, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "FileVersion: {0}{1}", new object[] { this.fileversion, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "FileDescription: {0}{1}", new object[] { this.filedescription, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "Product: {0}{1}", new object[] { this.productname, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "ProductVersion: {0}{1}", new object[] { this.productversion, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "Debug: {0}{1}", new object[] { this.isdebug, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "Patched: {0}{1}", new object[] { this.ispatched, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "PreRelease: {0}{1}", new object[] { this.isprerelease, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "PrivateBuild: {0}{1}", new object[] { this.isprivatebuild, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "SpecialBuild: {0}{1}", new object[] { this.isspecialbuild, Environment.NewLine }); FileVersionInfo.AppendFormat(stringBuilder, "Language {0}{1}", new object[] { this.language, Environment.NewLine }); return stringBuilder.ToString(); } // Token: 0x04000227 RID: 551 private string comments; // Token: 0x04000228 RID: 552 private string companyname; // Token: 0x04000229 RID: 553 private string filedescription; // Token: 0x0400022A RID: 554 private string filename; // Token: 0x0400022B RID: 555 private string fileversion; // Token: 0x0400022C RID: 556 private string internalname; // Token: 0x0400022D RID: 557 private string language; // Token: 0x0400022E RID: 558 private string legalcopyright; // Token: 0x0400022F RID: 559 private string legaltrademarks; // Token: 0x04000230 RID: 560 private string originalfilename; // Token: 0x04000231 RID: 561 private string privatebuild; // Token: 0x04000232 RID: 562 private string productname; // Token: 0x04000233 RID: 563 private string productversion; // Token: 0x04000234 RID: 564 private string specialbuild; // Token: 0x04000235 RID: 565 private bool isdebug; // Token: 0x04000236 RID: 566 private bool ispatched; // Token: 0x04000237 RID: 567 private bool isprerelease; // Token: 0x04000238 RID: 568 private bool isprivatebuild; // Token: 0x04000239 RID: 569 private bool isspecialbuild; // Token: 0x0400023A RID: 570 private int filemajorpart; // Token: 0x0400023B RID: 571 private int fileminorpart; // Token: 0x0400023C RID: 572 private int filebuildpart; // Token: 0x0400023D RID: 573 private int fileprivatepart; // Token: 0x0400023E RID: 574 private int productmajorpart; // Token: 0x0400023F RID: 575 private int productminorpart; // Token: 0x04000240 RID: 576 private int productbuildpart; // Token: 0x04000241 RID: 577 private int productprivatepart; } }