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

Reading number is top 10 articles
PHP入门:动态网页制作技术PHP的常量类型_[PHP教程]
.Net+MySQL组合开发(二),数据访问篇_[Asp.Net教程]
ASP.NET2.0中配置文件的加密与解密_[Asp.Net教程]
用SQL,SERVER记录站点日志_[SQL,Server教程]
Delphi浏览sql server数据库中的信息
用AjaxPro实现无刷新翻页效果及数据库分页技术介绍_[AJAX教程]
C#中Label控件应用实例
ASP.NET应用程序安全性问题_[Asp.Net教程]
一个有关SQL Server连接的问题_[SQL Server教程]
php 站点使用XML文件做配置类_[PHP教程]
Reading number is top 10 pictures
西游日记2
Fan bingbing black wings for platform and DanLuoWang believes beauty1
西游四格漫画(三)
运动的范冰冰2
俄罗斯台球天后惊艳魅惑1
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first2
The terra-cotta warriors3
The world's ten biggest attractions of inventory super the moon
2012 national geographic daily picture2
29 the belle stars after bath figure3
Download software ranking
SP3 for SQL2000
Unix video tutorial14
Tram sex maniac 2 (H) rar bag6
Kung.Fu.Panda.2
White deer villiage
1400篇各类破解文章
Proficient in JavaScript
豪门浪荡史
JSP+Ajax Web development typical examples
Sora aoi, the maid, students' uniforms
delv published in(发表于) 2014/1/24 9:16:15 Edit(编辑)
用Asp.Net获取目录的方法_[Asp.Net教程]

用Asp.Net获取目录的方法_[Asp.Net教程]

用Asp.Net获取目录的方法_[Asp.Net教程]


学习asp.net上传文件时,发现有三种方法可以获取当前web程序目录物理路径:

方法一:
string sPath = System.IO.Path.GetDirectoryName(Page.Request.PhysicalPath);

方法二:
string sPath = System.Web.HttpContext.Current.Request.MapPath("images/");  //("images/")是当前虚拟目录下的任意目录

方法三:
string sPath = Page.Server.MapPath("images/");  //("images/")是当前虚拟目录下的任意目录
sPath = Page.Server.MapPath(".");  //当前目录

另:获取全路径中的文件名
string sFile = System.IO.Path.GetFileName(sFile);






添加到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.