浏览模式: 普通 | 列表
9月, 2007 | 1
//p.s. 记一下,不然又忘记

//得到可执行文件的路径(包括名称)
string hostName = Application.ExecutablePath;

//获取最初指定程序的位置
hostName = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;

//获取程序的路径(包括名称)
hostName = System.Reflection.Assembly.GetExecutingAssembly().Location;

//获取程序的路径(不包括程序名称)
string hostName = System.Reflection.Assembly.GetExecutingAssembly().Location;
hostName = hostName.Substring(0 ...

阅读全文…
1