Application.StartupPath同System.Environment.CurrentDirectory区别
System.Windows.Forms.Application.StartupPath:获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。
System.Environment.CurrentDirectory:获取或设置当前工作目录的完全限定路径。
备注说明:假设你在桌面上打开了一个应用程序,在运行的过程使用OpenFileDialog()打开了E盘ABC文件夹下的某一个文件,此时CurrentDirectory会变成为E:\ABC,而StartupPath则不会改变,即启动路径不会改变。
Application.StartupPath同System.Environment.CurrentDirectory区别的更多相关文章
- 【摘抄】Application.StartupPath和System.Environment.CurrentDirectory的区别
System.Environment.CurrentDirectory的含义是获取或设置当前工作路径,而Application.StartupPath是获取程序启动路径,表面上看二者没什么区别,但实际 ...
- Application.StartupPath和System.Environment.CurrentDirectory的区别
System.Environment.CurrentDirectory的含义是获取或设置当前工作路径,而Application.StartupPath是获取程序启动路径,表面上看二者没什么区别,但实际 ...
- System.Environment.CurrentDirectory和Application.StartupPath
System.Environment.CurrentDirectory的含义是获取或设置当前工作路径,而Application.StartupPath是获取程序启动路径,表面上看二者没什么区别,但实际 ...
- 警惕System.Environment.CurrentDirectory 获取当前目录
最近工作中,要做个客户端提醒的小工具:winform程序自然少不了要读取和应用程序同一个目录的配置文件(不是exe.config文件): 要读取当前应用程序所在目录我立马想到了System.Envir ...
- 【C#遗补】获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPath的区别
原文:[C#遗补]获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPa ...
- C#中AppDomain.CurrentDomain.BaseDirectory与Application.StartupPath的区别
// 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. System.Diagnostics.Process.G ...
- C#: 获取当前路径不要用Environment.CurrentDirectory
网上大把文章写到C#获取当前路径的方法如下: // 获取程序的基目录. System.AppDomain.CurrentDomain.BaseDirectory // 获取模块的完整路径. Syste ...
- Directory.GetCurrentDirectory和Application.StartupPath的区别
System.IO.Directory.GetCurrentDirectory()方法用于获得应用程序当前工作目录.System.Windows.Forms.Application.StartupPa ...
- c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0);
本文实例总结了C#中WinForm程序退出方法技巧.分享给大家供大家参考.具体分析如下: 在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit ...
随机推荐
- android常见错误-The container 'Android Dependencies' references non existing library
The container 'Android Dependencies' references non existing library
- Upcase 将edit1中的每个字符串改为首字母大写
//将edit1中的每个字符串改为首字母大写 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin with ...
- 【问题汇总】ListView的FooterView设置可见性的问题
ListView的FooterView一般用来给用户展示一些提示信息. 正常情况下,是这么使用的.代码例如以下: // footer footerLayout = new PullLoadingLay ...
- 03---JavaScript基础整理
一.概述: Netscape开发的一种基于对象和事件驱动的脚本语言. 被设计用来想HTML页面添加交互行为. 无需编译,可由浏 ...
- Android权限设置android.permission完整列表
android.permission.ACCESS_CHECKIN_PROPERTIES允许读写访问"properties”表在checkin数据库中,改值可以修改上传( Allows re ...
- Google maps API开发(一)(转)
一.加载Google maps API <script type="text/javascript" src="http://ditu.google.com/map ...
- IPVS
http://kb.linuxvirtualserver.org/wiki/IPVS_FULLNAT_and_SYNPROXY
- php单引号、双引号与数据库
/** * 初始化http参数数据 */ public static function init () { if (!get_magic_quotes_gpc()) { $_POST = ...
- jemalloc源码结构分析(二):CPU字节对齐算法
在调用arena_malloc_small过程中,要根据申请内存大小,进行对齐计算,然后分配一个整块儿.算法如下: 1)定义一个SIZE_CLASSES宏,它主要用于生成后面两个表,small_siz ...
- NetBeans自定义代码折叠块,类似vs中的#region
//<editor-fold defaultstate="collapsed" desc="测试代码折叠"> echo '<script ty ...