惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
V
V2EX
美团技术团队
H
Help Net Security
月光博客
月光博客
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
U
Unit 42
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - Franky
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
MyScale Blog
MyScale Blog
B
Blog
雷峰网
雷峰网
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss

博客园 - 流泉飞石

转:ADO.Net Entity Framework : (七) 多條件查詢 转载:GridView 空记录时显示 Header 代码重构相关书籍 转:恢复Reflector反编译后资源文件的办法 WPF 回车转Tab实现跳转 C#自定义快捷键实现介绍 C#程序多用户只启动一个进程的方法[转载] C#中自定义快捷键【转载】 转:[WPF] WPF资源收集 分享 转:.NET开发人员必知的八个网站 WatermarkComboBox 和 WatermarkTextBox 转:c#中线程访问winform控件的若干问题 [转] DotNet资源站点汇总 DataKeyNames工作 - 流泉飞石 - 博客园 转:功能很强大的UIHelper类 转:动态修改webservice地址 转:CS结构软件自动升级实现 几个很好的url重写工具 SqlServer 查询sql执行时间
asp.net获取应用程序路径 - 流泉飞石 - 博客园
流泉飞石 · 2009-09-30 · via 博客园 - 流泉飞石

Code Snippet

  1. public static string ApplicationPath()
  2. {
  3.     string m_Application;
  4.     if (HttpContext.Current.Request.ApplicationPath.Equals("/"))
  5.     {
  6.         m_Application = "http://" + HttpContext.Current.Request.Url.Authority;
  7.     }
  8.     else
  9.         m_Application = HttpContext.Current.Request.ApplicationPath;
  10.     return m_Application;
  11. }

可以获取网站路径和虚拟目录路径

posted @ 2009-09-30 09:56  流泉飞石  阅读(511)  评论(0)    收藏  举报

刷新页面返回顶部