본문 바로가기

프로그래밍/ASP NET

Request.Url 객체

Request.Url 객체

 

- asp.net 클래스 : httpRequest 클래스

- 클라이언트에서 보낸 Http 값을 읽어오는 역활

- 네임스페이스 : System.Web

- Model 등의 Class에서 호출 : System.Web.HttpContext.Current.Request.Url

 

 

[ 속성 ]

경로: http://localhost:1004/testdic/test1.aspx?q=search&re=dkd

 

Request.Url.AbsolutePath : /testdic/test1.aspx

 

Request.Url.AbsoluteUri : http://localhost/testdic/test1.aspx?q=search&re=dkd

 

Request.Url.Authority : localhost:1004

 

Request.Url.Host : localhost

 

Request.Url.HostNameType : Dns

 

Request.Url.Port : 1004 

 

Request.Url.LocalPath : /testdic/test1.aspx

 

Request.Url.OriginalString : http://localhost:1004/testdic/test1.aspx?q=search&re=dkd

 

Request.Url.PathAndQuery : /testdic/test1.aspx?q=search&re=dkd

 

Request.Url.Query : q=search&re=dkd

 

 

Request 객체

 

[ 속성 ]

경로: http://localhost:1004/testdic/test1.aspx?q=search&re=dkd

 

Request.Path : /testdic/test1.aspx

 

Request.PhysicalPath : C:\Web\testdic\test1.aspx

 

Request.QueryString : q=search&re=dkd

 

Request.UserHostAddress : 60.243.141.170

 

Request.UserHostName : 60.243.141.170

 

Request.ApplicationPath : /myfunda

 

Request.Url : http://localhost/testdic/test1.aspx?q=search&re=dkd

 

 

 

응용

 

파일명 가져오기 : string filename = Path.GetFileName(Request.Path)

 

 

'프로그래밍 > ASP NET' 카테고리의 다른 글

C# 랜덤 함수  (2) 2012.12.04
C# 날자관련  (0) 2012.12.04
Html 문자열에서 이미지만 추출  (0) 2012.09.10
[MVC] UrlHelper WebViewPage.Url  (0) 2012.09.05
[Util] HTML 문자열 처리 관련 Method  (0) 2012.08.25