Asp.net uygulamalarinda kullanabilecegimiz sayfa ve dizin yolu kodlari asagidaki gibidir. Bu kodlari kullanarak uygulamalarin yollarina erisebiliriz.
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Response.Write("Kök dizin : " + HttpContext.Current.Request.Url.Host.ToString()
'Bulundugumuz sayfa
Response.Write("Bulundugumuz sayfa : " + HttpContext.Current.Request.Url.AbsolutePath.ToString()
'Bulundugumuz sayfa
Response.Write("Bulundugumuz sayfa : " + HttpContext.Current.Request.Path
'Bulundugumuz sayfa
Response.Write("Bulundugu dizin : " + HttpContext.Current.Request.FilePath
'Bulundugumuz sayfa
Response.Write("Bulundugu dizin : " + HttpContext.Current.Request.CurrentExecutionFilePath
'Full adres satiri
Response.Write("Full adres : " + HttpContext.Current.Request.Url.AbsoluteUri.ToString()
'Tam dizin adresi
Response.Write("Full dizin : " + HttpContext.Current.Request.PhysicalApplicationPath
'Portlu Full adres satiri
Response.Write("Portlu full adres : " + HttpContext.Current.Request.Url.OriginalString.ToString()
'Portu
Response.Write("Portu : " + HttpContext.Current.Request.Url.Port.ToString()
'Gönderilen deger
Response.Write("Gönderilen deger :" + HttpContext.Current.Request.Url.Query.ToString()
'Sayfa ve Gönderilen deger
Response.Write("Gönderilen deger :" + HttpContext.Current.Request.Url.PathAndQuery.ToString()
'http
Response.Write("http protokol : " + HttpContext.Current.Request.Url.Scheme.ToString()
'Kök Dizin
Response.Write("Host adresi : " + HttpContext.Current.Request.Url.Authority.ToString()
'Host
Response.Write("Host adresi : " + HttpContext.Current.Request.Url.Host.ToString()
'Kök Dizin
Response.Write("Host ismi tipi : " + HttpContext.Current.Request.Url.HostNameType.ToString()
'Uygulama Yolu
Response.Write("Uygulama yolu : " + HttpContext.Current.Request.ApplicationPath.ToString()
End Sub