//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#获取程序启动目录的更多相关文章

  1. Python获取程序运行目录和脚本目录

    Python获取程序运行目录和脚本目录 import os import sys #获取脚本所在目录 print os.path.split( os.path.realpath( sys.argv[0 ...

  2. WPF获取应用程序启动目录的方法

    1.AppDomain.CurrentDomain.BaseDirectory using System; namespace ConsoleApplication1 { class Program ...

  3. [转]WPF 获取程序启动路径

    本文转自:http://hi.baidu.com/lilipangtou/item/f1b7488e3c92c4d05e0ec1ab 在Windows Form程序中,获取自身的启动目录是非常容易的, ...

  4. [转] C# 获取程序运行目录

    来自 莫等闲也,原文 // 获取程序的基目录.  System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnosti ...

  5. C#获取程序所在目录路径

    方法1:Directory.GetCurrentDirectory().这个方法只能在.NET的完整版中使用,NETCF中不支持该功能,调用时会引发异常.获取的是当前目录,并不一定是真正的路径,跟Op ...

  6. WPF获取程序启动路径(StartupPath)

    1. 在传统的Winform中获取 可以使用: Application.StartupPath Application.ExecutablePath 很可惜,这些方法,在WPF中都失效啦 2. 在WP ...

  7. C# 获取程序运行目录

    string a = "BaseDirectory:" + AppDomain.CurrentDomain.BaseDirectory + "\r\n" + & ...

  8. c# 获取程序目录

    取得控制台应用程序的根目录方法1:Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径2:AppDomain.CurrentDomain.BaseDirect ...

  9. [Xcode 实际操作]七、文件与数据-(1)获取程序沙箱结构中常用的几个目录

    目录:[Swift]Xcode实际操作 本文将演示如何获取程序沙箱结构中,常见的几个目录. 在项目导航区,打开视图控制器的代码文件[ViewController.swift] import UIKit ...

随机推荐

  1. Codeforces Round #281 (Div. 2) A. Vasya and Football 模拟

    A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has starte ...

  2. API网关的设计思路及落地 IT大咖说 - 大咖干货,不再错过

    API网关的设计思路及落地 IT大咖说 - 大咖干货,不再错过   http://www.itdks.com/dakashuo/new/dakalive/detail/1407

  3. HNA CloudOS | 容器云服务专家

    HNA CloudOS | 容器云服务专家 http://cloudos.hnaresearch.com  

  4. Answer Sheet - Both, Either & Neither

    http://www.usingenglish.com/quizzes/answers.php?quiz_id=44 This page displays the answers to the 'Bo ...

  5. D3D9 effect (hlsl)(转)

      转:http://blog.csdn.net/leonwei/article/details/8212800 effect其实整合了shader和render state的控制两大部分内容 9.1 ...

  6. SQL 版本说明

    http://www.cnblogs.com/SameZhao/p/6184924.html The ProductMajorVersion产品主版本号 如: 12为 SQL SERVER 2014 ...

  7. man命令使用

    如:man 2 read, 就可以查看read函数的文档

  8. x86 TargetPlatform with XBAPs

    I've got a XAML Browser Hosted Application (XBAP) project that has a dependency on another project t ...

  9. 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 ...

  10. 更好使用jQuery的8个小技巧

    更好地使用jQuery,这里总结了8个小技巧. 1.DOM遍历是昂贵的,将变量缓存起来. //不推荐var h = $('#ele').height();$('#ele').css('height', ...