exe文件中的信息 [英] information from exe file

查看:24
本文介绍了exe文件中的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在物理路径F:\SAMPLEPRODUCT\Bin下有一个exe文件simpleservice.exe,我需要获取那个exe文件的版本号,能否给出获取版本号所需的代码

I have an exe file simpleservice.exe in the physical path F:\SAMPLEPRODUCT\Bin ,, i need to fetch version number of that exe file,,Can you give the code required to fetch the version number

推荐答案

我会使用以下方法来做到这一点:

I'd use the following to do this:

Assembly.LoadFrom("...").GetName().Version.ToString(); 

或者我会使用 FileVersionInfo 类.随心所欲:

or I'd use the FileVersionInfo class. Take your pick:

FileVersionInfo.GetVersionInfo("...");

这篇关于exe文件中的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆