比如我要运行HelloWorld.dll, 哪个API可以帮我取得这个dll的路径(比如c:\source\HelloWorld.dll)
System.Reflection.Assembly.GetExecutingAssembly().Location
// Get the DLL file Path
private static string DLLPathWithDLLName = System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Substring(8);
//截取掉DLL的文件名,得到DLL当前的路径
private static int Length = DLLPathWithDLLName.LastIndexOf("/");
private static string DLLPath = DLLPathWithDLLName.Substring(0,Length);
AppDomain.CurrentDomain.BaseDirectory.ToString();