.net - 如何以编程方式将文件识别为 .NET 程序集?

标签 .net asp.net

有没有办法轻松找到程序集?

最佳答案

How to programmatically determine if a file is an assembly

Call the GetAssemblyName method, passing the full file path and name of the file you are testing.

If a BadImageFormatException exception is thrown, the file is not an assembly.

http://msdn.microsoft.com/en-us/library/ms173100.aspx

关于.net - 如何以编程方式将文件识别为 .NET 程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1711290/

相关文章:

c# - 使用未经检查的上下文是否会影响 C# 中的性能或可移植性?

javascript - AsyncFileUpload 限制要上传的文件大小

c# - 是否有 `Task.Delay` 的变体在实时通过后过期,例如即使系统暂停和恢复?

c# - 如何排除 Sonar 路径中带空格的文件?

asp.net - ASP3 和 ASP.NET session 共享

asp.net - Crystal Report Viewer 按钮在 Google Chrome 和 Firefox 中不起作用,但在 IE 中正常

c# - C# 的事件列表,如 VB.NET 编辑器

c# - 如何在代码隐藏中引用 HTML <textarea> 控件的输入?

c# - 如何实例化对象并将其传递给 "using" block 声明中的方法

c# - 从 .NET 执行 Cygwin 进程?