博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C# Winform App 获取当前路径
阅读量:4691 次
发布时间:2019-06-09

本文共 1800 字,大约阅读时间需要 6 分钟。

直接双击执行 D:\test1.exe

System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName D:\Test1.exe
System.Environment.CurrentDirectory D:\
System.IO.Directory.GetCurrentDirectory()  D:\
System.AppDomain.CurrentDomain.BaseDirectory D:\
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase D:\
System.Windows.Forms.Application.StartupPath D:\
System.Windows.Forms.Application.ExecutablePath D:\Test1.exe
命令行执行,当前路径为C:\,执行D:\test1.exe
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName d:\Test1.exe
System.Environment.CurrentDirectory C:\
System.IO.Directory.GetCurrentDirectory()  C:\
System.AppDomain.CurrentDomain.BaseDirectory d:\
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase d:\
System.Windows.Forms.Application.StartupPath d:\
System.Windows.Forms.Application.ExecutablePath d:\Test1.exe
直接双击执行 D:\Test\Test1.exe
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName D:\Test\Test1.exe
System.Environment.CurrentDirectory D:\Test
System.IO.Directory.GetCurrentDirectory()  D:\Test
System.AppDomain.CurrentDomain.BaseDirectory D:\Test\
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase D:\Test\
System.Windows.Forms.Application.StartupPath D:\Test
System.Windows.Forms.Application.ExecutablePath D:\Test\Test1.exe
在F:\Test\建立快捷方式,设置起始位置为F:\Test,然后双击执行
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName D:\Test\Test1.exe
System.Environment.CurrentDirectory F:\Test
System.IO.Directory.GetCurrentDirectory()  F:\Test
System.AppDomain.CurrentDomain.BaseDirectory D:\Test\
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase D:\Test\
System.Windows.Forms.Application.StartupPath D:\Test
System.Windows.Forms.Application.ExecutablePath D:\Test\Test1.exe

转载于:https://www.cnblogs.com/StevenLi/p/4256393.html

你可能感兴趣的文章
C#和JAVA 访问修饰符
查看>>
小甲鱼OD学习第1讲
查看>>
HDU-1085 Holding Bin-Laden Captive-母函数
查看>>
php提示undefined index的几种解决方法
查看>>
LRJ
查看>>
Struts2环境搭建
查看>>
Linux: Check version info
查看>>
Javascript-正则表达式-开发中的使用.
查看>>
stl学习之测试stlen,cout等的运行速度
查看>>
入门GoldenGate总结
查看>>
魔戒三曲,黑暗散去;人皇加冕,光明归来
查看>>
Error和Exception
查看>>
Python和Singleton (单件)模式[转载]
查看>>
hibernate多对多单向(双向)关系映射
查看>>
二分查找题
查看>>
httpclient设置proxy与proxyselector
查看>>
IT常用单词
查看>>
拓扑排序
查看>>
NYOJ--32--SEARCH--组合数
查看>>
JMS
查看>>