当前位置:   article > 正文

C#获取当前程序集Assembly的文件名_c# assembly 文件名

c# assembly 文件名
C# Code:

string  codeBase = Assembly.GetExecutingAssembly().GetName().CodeBase;
返回结果:"file:///c:/users/administrator/documents/visual studio 2015/Projects/WindowsFormsApplication4/WindowsFormsApplication4/bin/Debug/WindowsFormsApplication4.EXE"  

string  file = Assembly.GetExecutingAssembly().GetName().Name;
返回结果:"WindowsFormsApplication4"  

string  location = Assembly.GetExecutingAssembly().Location;
返回结果:"c:\\users\\administrator\\documents\\visual studio 2015\\Projects\\WindowsFormsApplication4\\WindowsFormsApplication4\\bin\\Debug\\WindowsFormsApplication4.exe"  

string  fileName = Path.GetFileName(Assembly.GetExecutingAssembly().Location);
返回结果:"WindowsFormsApplication4.exe"
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/239415
推荐阅读
相关标签
  

闽ICP备14008679号