System.IO.Directory.GetCurrentDirectory与System.Windows.Forms.Application.StartupPath的用法
来源:互联网 发布:杨氏模量测量实验数据 编辑:程序博客网 时间:2024/06/05 09:41
.Net Framework中System.IO.Directory.GetCurrentDirectory()方法用于获得应用程序当前工作目录。如果使用此方法获得应用程序所在的目录,应该注意:System.IO.Directory.GetCurrentDirectory()方法获得的目录路径随着OpenFileDialog、SaveFileDialog等对象所确定的目录而改变(切换工作目录)。每打开一次文件夹或者使用资源管理器查看一下文件,都会更改此方法获得的值。
而System.Windows.Forms.Application.StartupPath或System.AppDomain.CurrentDomain.BaseDirectory可以获得应用程序运行所在的目录,它是不随你打开的文件夹而变的。只跟应用程序运行目录有关,其值等于应用程序启动的根目录。例如你安装了程序在了C:\Program Files\程序文件夹 的位置下,那么他就是System.Windows.Forms.Application.StartupPath的值。
本文来自CSDN博客,转载请标明出处:
http://blog.csdn.net/destimarve/archive/2009/02/09/3871582.aspx
http://www.cnblogs.com/zbo/archive/2009/06/05/1497024.html
阅读全文
0 0
- System.IO.Directory.GetCurrentDirectory与System.Windows.Forms.Application.StartupPath的用法
- System.IO.Directory.GetCurrentDirectory与System.Windows.Forms.Application.StartupPath用法浅谈
- System.Windows.Forms.Application.StartupPath
- Directory.GetCurrentDirectory和Application.StartupPath的区别
- Directory.GetCurrentDirectory和Application.StartupPath的区别
- System.IO.Directory.GetCurrentDirectory()方法
- System.Windows.Forms.Application.DoEvents()
- system.times.timer与system.windows.forms.timer的区别
- System.Windows.Forms.Timer与System.Timers.Timer的区别
- System.Windows.Forms.Timer与System.Timers.Timer的区别
- System.Windows.Forms.Timer与System.Timers.Timer的区别
- System.Windows.Forms.Timer与System.Timers.Timer的区别 .
- System.Windows.Forms.Timer与System.Timers.Timer的区别
- C#中Application.StartupPath和System.Environment.CurrentDirectory的区别
- C#中Application.StartupPath和System.Environment.CurrentDirectory的区别
- Application.StartupPath和System.Environment.CurrentDirectory的区别
- System.Environment.CurrentDirectory和Application.StartupPath的区别
- Application.StartupPath和System.Environment.CurrentDirectory的区别
- 利息、汇率与外汇
- 大话设计模式读后感之装饰模式
- 高可用、开源的Redis缓存集群方案
- c++ unique_lock与lock_guard的区别
- [USACO3.2]纺车的轮子 Spinning Wheels
- System.IO.Directory.GetCurrentDirectory与System.Windows.Forms.Application.StartupPath的用法
- VC++(unicode)实现URLDecode函数,对URl编码的字符串进行解码
- Cache 的作用
- 7.IDA-创建结构体
- 基于AWS搭载laravel
- 常见开源协议简介
- git ignore~
- 微信小程序入门——增删改查+页面跳转+传值取值+布局样式
- 视频会议十大开源项目排行