c# - 从 C# 读取非 .NET DLL 版本?

标签 c# dll

我有一个文件夹,里面有一些 DLL(不是 .NET 程序集),我想读取其中的文件信息。版本、名称等内容。处理此问题的最佳方法是什么?

最佳答案

使用 FileVersionInfo 对象。这是 Microsoft 网站上的一个示例,它从 notepad.exe 获取版本信息

public void GetFileVersion() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");

    // Print the file name and version number.
    textBox1.Text = "File: " + myFileVersionInfo.FileDescription + '\n' +
       "Version number: " + myFileVersionInfo.FileVersion;
 }

盗自 here .

关于c# - 从 C# 读取非 .NET DLL 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/349943/

相关文章:

c# - 检测 PowerModeChange 并等待执行

visual-studio - 当特定版本为 False 时特定版本的程序集引用

c# - Entity Framework - 如何避免查询重新编译?

c# - 使用蓝铜矿测试 Azure Blob 存储

dll - 从 VB6 exe 调试 VB6 dll

.net - 程序集加载版本不匹配 : Why is it loading?

c++ - 在静态库和 DLL 中使用静态成员 - 成员值正在重置

c++ - 如何让 C++ DLL 调用我重载的全局 new 运算符?

c# - 添加 .ToArray 或 .ToList 是否总能使数据库查询更快?

c# - 为什么这不会导致事件的无限循环?