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 ...
随机推荐
- Codeforces Round #281 (Div. 2) A. Vasya and Football 模拟
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has starte ...
- API网关的设计思路及落地 IT大咖说 - 大咖干货,不再错过
API网关的设计思路及落地 IT大咖说 - 大咖干货,不再错过 http://www.itdks.com/dakashuo/new/dakalive/detail/1407
- HNA CloudOS | 容器云服务专家
HNA CloudOS | 容器云服务专家 http://cloudos.hnaresearch.com
- Answer Sheet - Both, Either & Neither
http://www.usingenglish.com/quizzes/answers.php?quiz_id=44 This page displays the answers to the 'Bo ...
- D3D9 effect (hlsl)(转)
转:http://blog.csdn.net/leonwei/article/details/8212800 effect其实整合了shader和render state的控制两大部分内容 9.1 ...
- SQL 版本说明
http://www.cnblogs.com/SameZhao/p/6184924.html The ProductMajorVersion产品主版本号 如: 12为 SQL SERVER 2014 ...
- man命令使用
如:man 2 read, 就可以查看read函数的文档
- x86 TargetPlatform with XBAPs
I've got a XAML Browser Hosted Application (XBAP) project that has a dependency on another project t ...
- How AOT compares to a traditional JIT compiler
Ahead-of-Time (AOT) compilation is in contrast to Just-in-Time compilation (JIT). In a nutshell, .NE ...
- 更好使用jQuery的8个小技巧
更好地使用jQuery,这里总结了8个小技巧. 1.DOM遍历是昂贵的,将变量缓存起来. //不推荐var h = $('#ele').height();$('#ele').css('height', ...