使用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. Pytorch 基础

    Pytorch 1.0.0 学习笔记: Pytorch 的学习可以参考:Welcome to PyTorch Tutorials Pytorch 是什么? 快速上手 Pytorch! Tensors( ...

  2. Spark函数式编程进阶

    函数式编程进阶 1.函数和变量一样作为Scala语言的一等公民,函数可以直接复制给变量: 2.函数更长用的方式是匿名函数,定义的时候只需要说明输入参数的类型和函数体即可,不需要名称,但是匿名函数赋值给 ...

  3. Java中十个常见的违规编码

    摘要:作者Veera Sundar在清理代码工作时发现一些常见的违规编码,因此,Veera Sundar把针对常见的一些违规编码总结成一份列表,以便帮助Java爱好者提高代码的质量和可维护性. 最近, ...

  4. ab,qps 并发连接数

    并发连接数 = pv / 统计时间 * 页面衍生连接次数 * http响应时间 * 因数 / 其他web服务器 数量 pv = 并发连接数 * 统计时间 * 其他web服务器 数量/ 页面衍生连接次数 ...

  5. C++ 继承与派生

    继承的意义? 使程序的设计更符合发展规律,即事物的发展是一个从低级到高级的发展过程,类的继承也是反映由原始的简单代码到丰富的高级代码的过程.它能帮助我们描述事物的层次关系,有效而精确的理解事物,理解事 ...

  6. Linux进程优先级系统——设置实时进程优先级

    前言 最近研发的产品出了点小bug,最后查到根本原因是,其中一个进程A使用基于FIFO的实时进程优先级,而另一个进程B是使用普通调度的进程优先级,而A和B两个进程是互相通信的,进程B会被饿死,而进程A ...

  7. 20个有用的linux命令行技巧

    20 Unix Command Line Tricks – Part I http://www.cyberciti.biz/open-source/command-line-hacks/20-unix ...

  8. ECharts的geojson地图数据下载(根据城市区划代码的前六位查询)

    链接如下: http://echarts.baidu.com/echarts2/doc/example/geoJson/china-main-city/522200.json 想要对应城市的geojs ...

  9. 小程序canvas的一个坑

    很奇怪,原来好好的,结果现在显示乱了,模拟器和手机都不一样.模拟器上,整个canvas都往右偏移了,手机上,右侧有一大片空白. 反复试验,发现问题是:page的对齐方式是center引起的,改为lef ...

  10. Abp zero 示例运行

    https://aspnetboilerplate.com/Pages/Documents/Zero/Startup-Template-Core Introduction The easiest wa ...