string str = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
解码:Application.StartupPath 取程序启动路径
例如这样: “D:\C#XM\CeShi\CeShi\bin\Debug” 一开是取的是这样的东西
其实分开测试,就很容易懂的,一点就懂的,不妨可以自己断点试试看
分开测试:
int strCeShi = Application.StartupPath