使用FileVersionInfo获取版本信息

FileVersionInfo info = FileVersionInfo.GetVersionInfo(Application.Current.StartupUri + "ICC2.0.exe");
string productName = info.ProductName;
string productVersion = info.ProductVersion;
string companyName = info.CompanyName;
string legalCopyright = info.LegalCopyright;

FileVersionInfo相关属性

https://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo(v=vs.110).aspx

Name Description
Comments

Gets the comments associated with the file.

CompanyName

Gets the name of the company that produced the file.

FileBuildPart

Gets the build number of the file.

FileDescription

Gets the description of the file.

FileMajorPart

Gets the major part of the version number.

FileMinorPart

Gets the minor part of the version number of the file.

FileName

Gets the name of the file that this instance of FileVersionInfo describes.

FilePrivatePart

Gets the file private part number.

FileVersion

Gets the file version number.

InternalName

Gets the internal name of the file, if one exists.

IsDebug

Gets a value that specifies whether the file contains debugging information or is compiled with debugging features enabled.

IsPatched

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.

IsPreRelease

Gets a value that specifies whether the file is a development version, rather than a commercially released product.

IsPrivateBuild

Gets a value that specifies whether the file was built using standard release procedures.

IsSpecialBuild

Gets a value that specifies whether the file is a special build.

Language

Gets the default language string for the version info block.

LegalCopyright

Gets all copyright notices that apply to the specified file.

LegalTrademarks

Gets the trademarks and registered trademarks that apply to the file.

OriginalFilename

Gets the name the file was created with.

PrivateBuild

Gets information about a private version of the file.

ProductBuildPart

Gets the build number of the product this file is associated with.

ProductMajorPart

Gets the major part of the version number for the product this file is associated with.

ProductMinorPart

Gets the minor part of the version number for the product the file is associated with.

ProductName

Gets the name of the product this file is distributed with.

ProductPrivatePart

Gets the private part number of the product this file is associated with.

ProductVersion

Gets the version of the product this file is distributed with.

SpecialBuild

Gets the special build information for the file.

C#获取文件版本信息的更多相关文章

  1. Powershell 获取文件版本信息

    获取文件版本信息,通过FileVersionInfo::GetVersioninfo(file) 来获取信息 function Check-DdpstoreFileVersion{ $Ddpstore ...

  2. WIN32 API 获取文件版本信息

    CString strVersion; CString strPath(_T("xxxxxxxx.exe")); // 读文件信息 DWORD dwVerHnd = 0; DWOR ...

  3. win32api 获取文件版本信息

    #coding:utf-8 myPath="C:\\ime" import os from win32api import GetFileVersionInfo, LOWORD, ...

  4. Web 在线文件管理器学习笔记与总结(11)获取文件夹信息 (12)返回上一级操作

    (11)获取文件夹信息 文件夹没有修改操作. index.php: <?php require 'dir.func.php'; require 'file.func.php'; require ...

  5. [转]SVN使用log,list,cat,diff查看所有及特定文件版本信息

    [转]SVN使用log,list,cat,diff查看所有及特定文件版本信息 http://onefishum.blog.163.com/blog/static/5184730520113153402 ...

  6. C#获取apk版本信息

    获取很多人都会问我为什么要写这个博客,原因很简单,这次研发apk版本信息的时候网上查了很多的资料都没有这方面的信息,因此这次功能完了想写下方法,如果以后博友们遇到了可以直接copy,不用花很多的时间, ...

  7. os.path.join合并 os.path.dirname返回上一级目录 os.path.exists(path) os.stat('path/filename')获取文件/目录信息

    import os str1 = "grsdgfd" str2 = "wddf" str3 = "gddgs" # print(str1 + ...

  8. 获取windows版本信息的做法

    作者:朱金灿 来源:http://blog.csdn.net/clever101 个人不建议用 GetVersion 或GetVersionEx 之类的 API 来获取系统版本号.注意微软也说过,这个 ...

  9. C#获取文件版本、文件大小等信息

    使用以下C#程序代码可以非常方便地获取Windows系统中任意一个文件(尤其是可执行文件)的文件版本.文件大小.版权.产品名称等信息.所获取到的信息类似于在Windows操作系统中右键点击该文件,然后 ...

随机推荐

  1. 线程、对称多处理和微内核(OS 笔记三)

    线程.对称多处理 ​ 这一部分继续深入探讨与进程管理相关的高级概念并了解多处理机的对称多处理技术. 进程和线程 到目前为止提出的进程的概念包含两个特点: 资源所有权 存放进程映像的虚拟地址空间 调度/ ...

  2. VB.NET 编程元素支持更改总结

    Visual Basic 2005 更改了它支持各种编程元素的方式,主要是为了提供与公共语言运行库的互操作性.许多 Visual Basic 6.0 元素被重新命名,重新分类或与 Visual Bas ...

  3. python——append与extend

    编者注:本文主要参考了<Python核心编程(第二版)> 网上有很多对这两个函数的区别讲解,但我觉得都讲的不是很清楚,记忆不深刻.这样解释清楚且容易记住. list.append(obje ...

  4. Putty的用法

    大致内容罗列如下: ·        最简单的使用,登录 SSH主机 ·        中文乱码的处理 ·        PuTTY常用配置的说明 ·        复制.粘贴 ·        保存 ...

  5. map在遍历数据的过程中删除数据不出错

    // Iterator<Map.Entry<String,Long>> entries = Map.entrySet().iterator();                 ...

  6. ssm中的某些异常

    ---恢复内容开始--- (1)java.lang.NoClassDefFoundError: org/springframework/transaction/interceptor/Transact ...

  7. centos6.9 忘记密码解决方法

    若果忘记了 root 的密码,解决方法如下: 我采用的 linux 版本是 centos-6.9 , 经过亲身实践证明,该方法是 ok 的 在开机启动的时候按键盘上的“E”键会进入如下界面. 选择相应 ...

  8. 解决qt提示:qt.network.ssl: QSslSocket: cannot call unresolved function DH_free

    方法一(解决):把C:\Qt\Qt5.8.0\Tools\QtCreator\bin下的libeay32.dll和ssleay32.dll库复制到C:\Qt\Qt5.8.0\5.8\msvc2015_ ...

  9. nginx日志分析工具

    https://www.linuxidc.com/Linux/2016-12/138731.htm

  10. JNI编程实现(Windows)

    上一篇介绍了Linux平台的JNI编程方法,Windows平台的JNI本地调用基本类似,区别就是制作的动态库不同,Linux平台是*.so,Windows平台是*.dll.其中,Windows平台的函 ...