请问如何取得Application.StartupPath的上级目录,再线等,急 截取d:\myproject\bin最后一个\\之前的串 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str=Application.StarupPath;int postion;postion=str.LastIndexof(str,"\\");string utree=str.Substring(str,1,postion); DirectoryInfo mDir=new DirectoryInfo(Application.StartupPath); DirectoryInfo mDirF= mDir.Parent; MessageBox.Show(mDirF.FullName); string dir=Application.StartupPath+"\\..";dir就是上一级了用过DOS的都应知道吧 string path=Application.StartupPath+"\\..";path就是上一级目录的字符串了,用CMIC(大象) 的方法也行,都可以。 string appPath=Application.StartupPath;System.IO.DirectoryInfo topDir=System.IO.Directory.GetParent(appPath);string topDirPath=topDir.FullName;//topDirPath即上层目录 Application.StartupPath + "\\.." MDI窗体光标无法定位,求解决 类库中如何给win窗体的listbox中添加项目,调不出listbox哦 时间转换的问题?急急,在线等! 是高手,就进来 如何打印C#中使用的ActiveX控件 如何禁止textbox的右键弹出的系统菜单? aspx中如何显示web控件库中创建的form窗体? c#.net sqlCommandbuilder 更新DATATABLE时可以按条件更新吗 为什么原本运行好好的程序总提示同一个错误? C#中如何获得本地机器名 如何动态加载用户控件?? help!!!!!!!!!!!!!!!!!
int postion;
postion=str.LastIndexof(str,"\\");
string utree=str.Substring(str,1,postion);
DirectoryInfo mDirF= mDir.Parent;
MessageBox.Show(mDirF.FullName);
dir就是上一级了
用过DOS的都应知道吧
path就是上一级目录的字符串了,用CMIC(大象) 的方法也行,都可以。
System.IO.DirectoryInfo topDir=System.IO.Directory.GetParent(appPath);string topDirPath=topDir.FullName;//topDirPath即上层目录