📜  c# 执行程序集路径 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:13.397000             🧑  作者: Mango

代码示例1
public static string AssemblyDirectory
{
    get
    {
        string codeBase = Assembly.GetExecutingAssembly().CodeBase;
        UriBuilder uri = new UriBuilder(codeBase);
        string path = Uri.UnescapeDataString(uri.Path);
        return Path.GetDirectoryName(path);
    }
}