Winform开发笔记 - 获取当前文件所在地址

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);
}
}

posted @ 2018-08-17 17:12  戴帽子的家猫  阅读(173)  评论(0)    收藏  举报