All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
在ASP.NET中防止注入攻击[翻译]_[Asp.Net教程]
delphi获取System目录
PHP实例:将IP最后一位替换为星号_[PHP教程]
ASP.NET2.0的新增服务、控件与功能_[Asp.Net教程]
基于AJAX.NET技术的DataGrid控件开发_[Asp.Net教程]
C#开发里List控件的使用方法介绍_.net资料_编程技术
C#.NET函数和方法集_[Asp.Net教程]
详细讲解动态网页制作技术PHP中的函数应用_php资料_编程技术
扩展Label控件(1),-,实现回发(Postback)功能_[Asp.Net教程]
javascript代码格式化和语法着色_JavaScript技术_编程技术
Reading number is top 10 pictures
30 beautiful school beauty6
真正的国产-非模拍 贵在是真实2
青春清纯美女大集合2
壮丽的云彩2
A man's favorite things15
China's first snake village1
Azusa Yamamoto1
Sora aoi possession photo1
小学生作文又现神作,你不得不佩服
So beauty, will let you spray blood1
Download software ranking
Tram sex maniac 2 (H) rar bag4
Boxer's Top ten classic battle3
超级战舰
Unix video tutorial7
The Bermuda triangle2
Kung fu panda - the secret of the teacher
尖东毒玫瑰A
Unix video tutorial19
Tram sex maniac 2 (H) rar bag9
美女写真2
归海一刀 published in(发表于) 2014/1/30 1:26:04 Edit(编辑)
C#得到文件路径,几种不同需求_[Asp.Net教程]

C#得到文件路径,几种不同需求_[Asp.Net教程]

C#得到文件路径,几种不同需求_[Asp.Net教程]
C# 获取路径
string str1 =Process.GetCurrentProcess().MainModule.FileName;//获得当前执行的exe的文件名。
string str2=Environment.CurrentDirectory;//获取和设置当前目录的完全限定路径。
string str3=Directory.GetCurrentDirectory();//获取应用程序的当前工作目录。
string str4=AppDomain.CurrentDomain.BaseDirectory;//获取基目录,它由程序集冲突解决程序用来探测程序集。
string str5=Application.StartupPath;//获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。
string str6=Application.ExecutablePath;//获取启动了应用程序的可执行文件的路径,包括可执行文件的名称。
string str7=AppDomain.CurrentDomain.SetupInformation.ApplicationBase;//获取或设置包含该应用程序的目录的名称。

“Application.StartupPath”:获取当前应用程序所在目录的路径,最后不包含“\”;
“Application.ExecutablePath ”:获取当前应用程序文件的路径,包含文件的名称;
“AppDomain.CurrentDomain.BaseDirectory”:获取当前应用程序所在目录的路径,最后包含“\”;
“System.Threading.Thread.GetDomain().BaseDirectory”:获取当前应用程序所在目录的路径,最后包含“\”;
“Environment.CurrentDirectory”:获取当前应用程序的路径,最后不包含“\”;
“System.IO.Directory.GetCurrentDirectory”:获取当前应用程序的路径,最后不包含“\”;


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.