使用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. 【RAY TRACING THE REST OF YOUR LIFE 超详解】 光线追踪 3-2 蒙特卡罗(二) 重要性采样

    书本内容:见相册 preface 还记的我们上一篇说的Monte Carlo 维度诅咒吗 上一篇算是二维的例子吧,大家看了之后是否想着写一个一维的Monte Carlo模拟积分?(我想了,没写出来) ...

  2. win7 资源资源管理器访问FTP站点

    Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\ftp] @="URL:File Transfer Protocol" ...

  3. 618大促微服务、web、redis等的超时时间

    1. 最近因为大促原因线上服务不稳定,不稳定主要是redis经常超时并且数据为定时mGet方式获得 节点一多,所有服务节点同时获取数据访问量变大导致get取数据变慢因mGet会对数据进行锁住操作, 此 ...

  4. AGC 027C.ABland Yard(拓扑/二分图)

    题目链接 \(Description\) 给定一张图(可能存在自环),每个点上有A或B.求是否存在一条路径,使得在上面不断走,能够得到所有AB串组合(可以重复经过点). \(n\leq2\times1 ...

  5. 潭州课堂25班:Ph201805201 WEB 之 CSS 第三课 (课堂笔记)

    在 CSS 中第个标签都可以认为是个盒子,盒子就有以下几层 边框 border border-top: 5px solid black; /*上边框 实线*/ border-right: 3px do ...

  6. 小B的询问

    OJ题号:BZOJ3781.洛谷2709 思路: 根据平方和公式,$(a+b)^2=a^2+2ab+b^2$,即当$c_i$增加$1$时,新的答案增加$2C_i+1$,减少时亦同.莫队求解即可. #i ...

  7. angularJs中的checkboxs

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  8. win7下一劳永逸地解决触控板禁用的问题

    win7下一劳永逸地解决触控板禁用的问题--有鼠标时触摸板不再可用, 没鼠标时才启用 下载Synaptics触摸板驱动并安装(去官网或驱动之家都可以) →重启 开始→运行→框内输入 regedit 点 ...

  9. fastJson解析复杂的json字符串,经测试已经成功解析

    要解析的json数据格式为: HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { ResponseStatus: { }, ...

  10. PHP Redis 对象方法手册

    redis(Remote Dictionary Server)是一种Nosql技术,它是一个开源的高级kv存储和数据结构存储系统. redis不仅仅是能够存储key和value这种简单的键值对,还能存 ...