`
新颖666666
  • 浏览: 31339 次
  • 性别: Icon_minigender_1
最近访客 更多访客>>
社区版块
存档分类
最新评论

wiform中获取当编写代码右侧可以看见的文件夹的路径的方法

 
阅读更多
           

这个原理是先获取根目录之后再利用字符串截取和拼接来实现的
[/align][align=center]


#region 保存路径为项目的根目录,从debug目录往上截取两级文件夹
            string rootpath = Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\"));
            rootpath = rootpath.Substring(0, rootpath.LastIndexOf("\\"));
            //文件保存文件夹路径
            //string savepath = rootpath + "\\Picture";
#endregion
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics