原方法可行,但发现网友方法更好。遂改之。
string appPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
自己又发现一个不错方法:
string appPath = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);
原方法可行,但发现网友方法更好。遂改之。
string appPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
自己又发现一个不错方法:
string appPath = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);