西沉_NET

NET技术
posts - 4, comments - 2, trackbacks - 0, articles - 0
  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

返回应用程序的绝对路径

Posted on 2005-12-12 17:48 西沉 阅读(73) 评论(0)  编辑 收藏 引用

 

 1/// <summary>
 2/// 返回应用程序的绝对路径
 3/// </summary>
 4/// <returns></returns>

 5  public static string root()
 6  {
 7   string serverpath=HttpContext.Current.Request.ServerVariables["HTTPS"];
 8   string pro=(serverpath=="on")?"https://":"http://";
 9
10   string servername=HttpContext.Current.Request.ServerVariables["Server_Name"];
11   string appname=HttpContext.Current.Request.ApplicationPath;
12
13   string path=pro+servername+appname;
14   return path;
15  }

16 }
17

每天10分钟,轻松学英语
专题:iPad  jQuery  Chrome OS
博客园首页  IT新闻  程序员微博  招聘频道  学英语
标题  
姓名  
主页
验证码 *
内容(提交失败后,可以通过“恢复上次提交”恢复刚刚提交的内容)
 
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
[使用Ctrl+Enter键可以直接提交]
Windows 7专题

相关链接: