日期:2014-05-18 浏览次数:21182 次
//获取到bin目录的下层路径:bin\Debug\ string aa = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; string cc = System.AppDomain.CurrentDomain.BaseDirectory; //获取到bin目录:bin\Debug string dd = System.Environment.CurrentDirectory; string ee = System.IO.Directory.GetCurrentDirectory(); string ff = System.Windows.Forms.Application.StartupPath; //获取程序.exe string bb = System.Windows.Forms.Application.ExecutablePath;
------解决方案--------------------
string filePath = Application.StartupPath + @"/aaa.xml";
------解决方案--------------------
XmlDocument mydom = new XmlDocument(); mydom.Load(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)+ @"\xxx.xml");