string s = Environment.CurrentDirectory;
//需添加Forms.DLL
s = System.Windows.Forms.Application.StartupPath;
s = System.Windows.Forms.Application.ExecutablePath; s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
s = System.Reflection.Assembly.GetEntryAssembly().Location;

C#获取应用程序路径的更多相关文章

  1. 【C#遗补】获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPath的区别

    原文:[C#遗补]获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPa ...

  2. 20180821 Python学习笔记:如何获取当前程序路径

    20180821 Python学习笔记:如何获取当前程序路径 启动的脚本的路径为:D:\WORK\gitbase\ShenzhenHouseInfoCrawler\main.py 当前脚本的路径为:D ...

  3. VC中使用GetModuleFileName获取应用程序路径

      .\\与API函数GetModuleFileName获取应用程序目录有何不一样? 采用.\\也能获得应用程序目录,采用GetModuleFileName也能获得,二者有何不同? 一样!一个是相对路 ...

  4. GetModuleFileNameEx遍历获取64bit程序路径失败的一种解决方法(Win7-64-bit)

    问题: 32位程序在64位系统上调用GetModuleFileNameEx()遍历获取64位进程的全路径失败,得到的路径都为空. 根据官方的说法: For the best results use t ...

  5. windows和linux下获取当前程序路径以及cpu数

    #ifdef WIN32 #include <Windows.h> #else #include <stdio.h> #include <unistd.h> #en ...

  6. linux 获取当前程序路径

    const std::string strCfgName = "logger_import_db.conf" ;bool fGetCfgFileName(std::string&a ...

  7. C# 获取控制台程序路径

  8. Android获取程序路径 (/data/data/appname)

    Android获取文件夹路径 /data/data/ http://www.2cto.com/kf/201301/186614.html String printTxtPath = getApplic ...

  9. C# 通过窗口句柄获取程序路径 图标

    转自:http://qqhack8.blog.163.com/blog/static/11414798520113363829505/ C# 通过窗口句柄获取程序路径 图标using System;u ...

随机推荐

  1. golang web实战之一(beego,mvc postgresql)

    想写个小网站,听说MVC过时了,流行MVVM,但是看了一下gin+vue+axios方式,发现还有一堆知识点要掌握,尤其是不喜欢nodejs和javascript方式的写法.算了,还是用beego来写 ...

  2. 监控glusterfs

    监控集群状态 [4ajr@elk1 scripts]$ cat glusterfs_peer_status.sh #!/bin/bash peer_status=`sudo gluster peer ...

  3. mysql中group by和order by混用 结果不是理想结果(转)

    文章转自 https://www.cnblogs.com/myphper/p/3767572.html 在使用mysql排序的时候会想到按照降序分组来获得一组数据,而使用order by往往得到的不是 ...

  4. JavaScript简单了解

    一.JavaScript 的诞生历史 在最初的时候 JS 主要解决的问题是一些服务器端语言(perl)对数据的 验证功能,在js 出现之前要对表单的数据进行验证需要将数据提交到服务器 端之后才能验证数 ...

  5. Docker启动Get Permission Denied

    https://www.cnblogs.com/informatics/p/8276172.html 以下问题及解决方法都在Ubuntu16.04下,其他环境类似 问题描述 安装完docker后,执行 ...

  6. 【Swift】iOS开发笔记(一)

    前言 边开发边学习,边攒经验,汇总一下记录到这里 声明 欢迎转载,但请保留文章原始出处:) 博客园:http://www.cnblogs.com 农民伯伯: http://over140.cnblog ...

  7. Binary Search(Java)(非递归)

    public static int rank(int[] array, int k) { int front = 0, rear = array.length - 1; while(front < ...

  8. vue-百度地图-maker文字标签显示隐藏

    html: <div id="allmap" class="map"></div>   script:   mounted() { th ...

  9. Notepad++ PluginManager安装常用插件

    参考: https://blog.csdn.net/u014611492/article/details/80849211

  10. ckeditor,关于数据回显