易截截图软件、单文件、免安装、纯绿色、仅160KB

URL 的各个部分和通过ASP.NET获取URL地址的方法


網址:http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
Request.ApplicationPath
/
Request.PhysicalPath
D:\Projects\Solution\web\News\Press\Content.aspx
System.IO.Path.GetDirectoryName(Request.PhysicalPath)
D:\Projects\Solution\web\News\Press
Request.PhysicalApplicationPath
D:\Projects\Solution\web\
System.IO.Path.GetFileName(Request.PhysicalPath)
Content.aspx
Request.CurrentExecutionFilePath
/News/Press/Content.aspx
Request.FilePath
/News/Press/Content.aspx
Request.Path
/News/Press/Content.aspx/123
Request.RawUrl
/News/Press/Content.aspx/123?id=1
Request.Url.AbsolutePath
/News/Press/Content.aspx/123
Request.Url.AbsoluteUri
http://localhost:1897/News/Press/Content.aspx/123?id=1
Request.Url.Scheme
http
Request.Url.Host
localhost
Request.Url.Port
1897
Request.Url.Authority
localhost:1897
Request.Url.LocalPath
/News/Press/Content.aspx/123
Request.PathInfo
/123
Request.Url.PathAndQuery
/News/Press/Content.aspx/123?id=1
Request.Url.Query
?id=1
Request.Url.Fragment
Request.Url.Segments
/
News/
Press/
Content.aspx/
123
如果测试的url地址是http : //www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PhysicalApplicationPath: E:\WWW\testwebRequest.PhysicalPath:
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUrl: [url]http://www.test.com/testweb/default.aspx[/url]
Request.Url.Host: [url]www.test.com[/url]
Request.Url.LocalPath: /testweb/default.aspx


相关文档:

js C# ASP.Net 正则去掉超链接(只是 和 )

//替换所有
Regex reg = new Regex(@"(?is)</?a\b[^>]*>(?:(?!</?a).)*</a>");
string result = reg.Replace(yourStr, "");
//保留www.abc.com链接
Regex reg = new Regex(@"(?is)</?a\b.*?href=(['""]?)(?!(?:http://)?www\.abc\.com)[^'""\s>]+\1[^>]*>(?<text>(?:(?!</?a).) ......

ASP.NET程序中常用的三十三种代码

1. 打开新的窗口并传送参数:
  传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
  接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
  2.为按钮添加对话框
Button1 ......

asp.net导出成EXCEL

以下是导出的方法:
public static void ToExcel(System.Web.UI.Control ctl)
    {
        //HttpContext.Current.Response.Charset   ="GB2312";  
        HttpContext.Current.Response.Charset = "G ......

对联广告不滚动的问题 asp.net 页面

对联广告不滚动的问题 asp.net 页面
2008年06月11日 星期三 11:01
在页面上加了对联广告后发现不滚动,找了N久才发现是<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">这句导致不滚动的,可是如果去掉的话对于用DIV+CSS开发的网站来说又是灾难要另外找解 ......

ASP.NET应用程序设计的10大技巧

在本篇文章中,我们将讨论编程人员在使用ASP.NET开发应用程序时需要注意的10个技巧,这些技巧涉及从缺省的控件、表单名的改变到StringBuilder类的使用,有助于编程人员能够尽快地适应.NET环境。
  1、在使用Visual Studio .NET时,除直接或非引用的对象外,不要使用缺省的名字
  .NET带来的好处之一是所有的源代码和 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号