gpt4 book ai didi

c# - 如何找出另一个程序集的 ProductName 属性?

转载 作者:太空宇宙 更新时间:2023-11-03 18:47:25 25 4
gpt4 key购买 nike

我有两个程序集 A.exe 和 B.exe。两者都是 Windows.Forms .net 3.5 程序集。 A.exe 知道 B.exe 在同一个目录下。

如何从A.exe中找出B.exe的ProductName

最佳答案

FileVersionInfo 类在这里很有用。 [AssemblyProduct] 属性被编译到非托管版本信息资源中。此代码适用于任何 .exe:

    private void button1_Click(object sender, EventArgs e) {
var info = System.Diagnostics.FileVersionInfo.GetVersionInfo(@"c:\windows\notepad.exe");
MessageBox.Show(info.ProductName);
}

关于c# - 如何找出另一个程序集的 ProductName 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3158677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com