C#获取程序启动目录
//WCF service:
string servicePath = System.Web.Hosting.HostingEnvironment.MapPath("~"); //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\
string strBaseDirectory = System.AppDomain.CurrentDomain.BaseDirectory; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\EHR.vshost.exe
string strMainModule = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug
string strCurrentDirectory = System.Environment.CurrentDirectory; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug
string strGetCurrentDirectory = System.IO.Directory.GetCurrentDirectory(); //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\
string strApplicationBase = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug
string strStartupPath=System.Windows.Forms.Application.StartupPath; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\EHR.EXE
string strExecutablePath = System.Windows.Forms.Application.ExecutablePath;
C#获取程序启动目录的更多相关文章
- Python获取程序运行目录和脚本目录
Python获取程序运行目录和脚本目录 import os import sys #获取脚本所在目录 print os.path.split( os.path.realpath( sys.argv[0 ...
- WPF获取应用程序启动目录的方法
1.AppDomain.CurrentDomain.BaseDirectory using System; namespace ConsoleApplication1 { class Program ...
- [转]WPF 获取程序启动路径
本文转自:http://hi.baidu.com/lilipangtou/item/f1b7488e3c92c4d05e0ec1ab 在Windows Form程序中,获取自身的启动目录是非常容易的, ...
- [转] C# 获取程序运行目录
来自 莫等闲也,原文 // 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnosti ...
- C#获取程序所在目录路径
方法1:Directory.GetCurrentDirectory().这个方法只能在.NET的完整版中使用,NETCF中不支持该功能,调用时会引发异常.获取的是当前目录,并不一定是真正的路径,跟Op ...
- WPF获取程序启动路径(StartupPath)
1. 在传统的Winform中获取 可以使用: Application.StartupPath Application.ExecutablePath 很可惜,这些方法,在WPF中都失效啦 2. 在WP ...
- C# 获取程序运行目录
string a = "BaseDirectory:" + AppDomain.CurrentDomain.BaseDirectory + "\r\n" + & ...
- c# 获取程序目录
取得控制台应用程序的根目录方法1:Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径2:AppDomain.CurrentDomain.BaseDirect ...
- [Xcode 实际操作]七、文件与数据-(1)获取程序沙箱结构中常用的几个目录
目录:[Swift]Xcode实际操作 本文将演示如何获取程序沙箱结构中,常见的几个目录. 在项目导航区,打开视图控制器的代码文件[ViewController.swift] import UIKit ...
随机推荐
- CentOS安装openvpn报错:error: route utility is required but missing
centos7特有,直接安装net-tools即可. 参考: https://forums.openvpn.net/viewtopic.php?t=21432
- External Input Counter and External interrupt
External Input Counter and External interrupt : count the input signal from the button. So what is t ...
- [Go] 命令行参数解析包(flag 包)使用详解
Go 的 flag 包可以解析命令行的参数. 一.命令行语法 命令行语法主要有以下几种形式: cmd -flag // 只支持bool类型 cmd -flag=xxx cmd -flag ...
- spanner-becoming-a-sql-system 2017
https://blog.acolyer.org/2017/07/03/spanner-becoming-a-sql-system/?utm_source=tuicool&utm_medium ...
- JAVA GC 图解
http://www.cnblogs.com/hnrainll/archive/2013/11/06/3410042.html http://www.blogjava.net/ldwblog/arch ...
- Unity3d学习笔记记录
1.发布到 ipad字体显示不出来,改变Position位置的Z轴为-1 2.发布打包有问题,记得用户权限有没有设置 3.ipad4分辨率:2048*1536 4.调整界面大小,尽量调整底下子对象位置 ...
- WebLogic使用总结(四)——WebLogic部署Web应用
一.打包Web应用 首先将要部署到WebLogic的Web应用打包成war包,具体操作步骤如下图所示: 选中要打包的[oams]项目→[Export...]
- Linux source命令(转)
Linux source命令: 通常用法:source filepath 或 . filepath 功能:使当前shell读入路径为filepath的shell文件并依次执行文件中的所有语句,通常用于 ...
- firedac连接WINDOWS的ORACLE
firedac连接WINDOWS的ORACLE 首先安装OCI FOR WINDOWS.OCI分WIN32和WIN64,且OCI的版本要和ORACLE的版本相一致才行. FIREDAC指定OCI驱动程 ...
- Python index()方法
Python index()方法 Python 字符串 描述 Python index() 方法检测字符串中是否包含子字符串 str ,如果指定 beg(开始) 和 end(结束) 范围,则检查是否 ...