winform 获取当前项目所在的路径
代码:
string curAppPath = System.IO.Directory.GetParent(System.Environment.CurrentDirectory).Parent.FullName;
首先通过 System.Environment.CurrentDirectory 可以获取 debug(如果是在debug状态)的路径;如 F:\gis\arcgis_engine\Engine\Engine\bin\Debug
然后用 System.IO.Directory.GetParent(pathName).Parent.FullName获得父目录的父目录.如 F:\gis\arcgis_engine\Engine\Engine
winform 获取当前项目所在的路径的更多相关文章
- JavaScript中获取当前项目的绝对路径
近期在做JavaWeb项目相关的东西,差点儿每天都遇到非常多问题,主要是由于自己对JavaWeb方面的知识不是非常清楚,尽量把自己在项目中遇到的问题都记录下来,方便以后查阅. 在我们的项目中有这种须要 ...
- spring中获取当前项目的真实路径
总结: 方法1: WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext ...
- 获取 web 项目的绝对路径
获取 web 项目的绝对路径 <% String path = request.getContextPath(); String basePath = request.getScheme()+& ...
- Winform获取当前程序名称或路径
以下几种方法获取当前程序名称或路径: // 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. // 获 ...
- java获取当前项目或类路径
// 获取当前项目的目录 File directory = new File("");// 参数为空 String courseFile = directory.getCanoni ...
- 获取web项目的绝对路径的方法总结
一.用Jsp获取 1.获取文件的绝对路径 String file="文件";(例如:data.mdb) String path=application.getRealPath(fi ...
- asp.net 获取当前项目的根目录路径
获取网站根目录的方法有几种如: Server.MapPath(Request.ServerVariables["PATH_INFO"]) Server.MapPath(" ...
- controller中获取当前项目物理绝对路径
用HttpServletRequest request获取 request.getSession().getServletContext().getRealPath(""); 上面 ...
- Java 获取当前项目所在服务器的 IP 地址
java中获取当前服务器地址主要使用到InetAddress这个类 public static void main(String[] args) { try { //用 getLocalHost() ...
随机推荐
- 学习OpenSeadragon之三 (覆盖层Overlayer的使用)
Overlayer(覆盖层)是一个很重要的机制,它可以在可缩放图片上显示额外的信息. 1.简单应用 以下是我做出的一个小例子: 看这小老鼠头部的红色框内的部分就是一个分离出来的overlay. 介绍一 ...
- 记录Linux下安装elasticSearch时遇到的一些错误
记录Linux下安装elasticSearch时遇到的一些错误 http://blog.sina.com.cn/s/blog_c90ce4e001032f7w.html (2016-11-02 22: ...
- windows编辑文本和unix编辑文本的回车符问题
我们的开发环境一般都使用windows操作系统,而测试环境和线上环境一般使用linux.windows下编辑的shell脚本,上传到windows下会发生错误.出现两种情况: 1.BOM头问题,前面有 ...
- recovery编译汉化源码开源地址
本Recovery基于xiaolu开源的不完全汉化版源码,进行完全汉化,并合并Philz的最新源码. 汉化耗费我将近一整天的精力,纯手打,可能有遗漏或翻译不准的地方,请到微博反馈 本Rec完全开源,便 ...
- 父Prefab与子prefab问题
PrefabRevolution 原文:http://framebunker.com/blog/poor-mans-nested-prefabs/ (溜还是老外溜啊) 有些时候需要在Prefab里 ...
- grunt serve Warning: Running "sass:server" (sass) task
使用grunt serve运行时遇到一问题: y@y:ydkt$ grunt serve Running "serve" task Running "clean:serv ...
- Delphi判断进程是否存在(使用CreateToolhelp32Snapshot)
program Project2; uses windows,TLHelp32; function FindProcess(AFileName:string):boolean; var hSnap ...
- android 复杂的json数据解析
1.通过谷歌的Gson来进行解析: json数据:sTotalString = {"message":"success","result": ...
- POJ_2488——骑士遍历棋盘,字典序走法
Description Background The knight is getting bored of seeing the same black and white squares again ...
- BZOJ2038: [2009国家集训队]小Z的袜子(hose) -- 莫队算法 ,,分块
2038: [2009国家集训队]小Z的袜子(hose) Time Limit: 20 Sec Memory Limit: 259 MBSubmit: 3577 Solved: 1652[Subm ...