秋霞国产一综合影院在线_韩日国产一区二区_欧美高清e片在线观看_国产精品理论片在线播放

  • <span id="iiock"><code id="iiock"></code></span>

    <address id="iiock"><var id="iiock"><center id="iiock"></center></var></address>

    <menu id="iiock"></menu>

    1. 濟(jì)寧果殼科技專業(yè)軟件開發(fā)團(tuán)隊(duì),提供全方位的互聯(lián)網(wǎng)服務(wù)!
      座機(jī):15563775221 手機(jī):15563775221(微信)

      熱門標(biāo)簽

      1. 首頁
      2. 果殼學(xué)院
      3. 技術(shù)顧問
      4. 使用asp.net 獲取當(dāng)前網(wǎng)址/url/域名 怎么處理呢?
      使用asp.net  獲取當(dāng)前網(wǎng)址/url/域名  怎么處理呢?

      使用asp.net 獲取當(dāng)前網(wǎng)址/url/域名 怎么處理呢?

      獲取當(dāng)前網(wǎng)址/url/域名

      濟(jì)寧果殼科技

      2017-06-06 18:46:25

      15

      6263


      使用asp.net  獲取當(dāng)前網(wǎng)址/url/域名  怎么處理呢?


      設(shè)當(dāng)前頁完整地址是:http://www.lt888999.com/college/117.html

      "http://"是協(xié)議名

      "www.lt888999.com"是域名

      "college"是站點(diǎn)目錄名

      "117.html"是頁面名(文件名)

      【1】獲取 完整url (協(xié)議名+域名+站點(diǎn)名+文件名+參數(shù))

      代碼如下:


      string url=Request.Url.ToString();

      url  值為  http://www.lt888999.com/college/117.html



      【2】獲取 站點(diǎn)名+頁面名+參數(shù):

      代碼如下:


      string url=Request.RawUrl;

      (或 string url=Request.Url.PathAndQuery;)

      url 值為 /college/117.html



      【3】獲取 站點(diǎn)名+頁面名:

      代碼如下:


      string url=HttpContext.Current.Request.Url.AbsolutePath;

      (或 string url= HttpContext.Current.Request.Path;)

      url  值為 college/117.html



      【4】獲取 域名:

      代碼如下:


      string url=HttpContext.Current.Request.Url.Host;

      url  值為 www.lt888999.com/college



      【5】獲取 參數(shù):

      代碼如下:


      string url= HttpContext.Current.Request.Url.Query;

      url  類似于  ?id=5




      代碼如下:


      Request.RawUrl:獲取客戶端請(qǐng)求的URL信息(不包括主機(jī)和端口)------>/117.html

      Request.ApplicationPath:獲取服務(wù)器上ASP.NET應(yīng)用程序的虛擬路徑。------>/

      Request.CurrentExecutionFilePath:獲取當(dāng)前請(qǐng)求的虛擬路徑。------>/117.html

      Request.Path:獲取當(dāng)前請(qǐng)求的虛擬路徑。------>/117.html

      Request.PathInfo:取具有URL擴(kuò)展名的資源的附加路徑信息------>

      Request.PhysicalPath:獲取與請(qǐng)求的URL相對(duì)應(yīng)的物理文件系統(tǒng)路徑。------>E:\temp\117.html

      Request.Url.LocalPath:------>/117.html

      Request.Url.AbsoluteUri:------>http://localhost:8080/117.html

      Request.Url.AbsolutePath:---------------------------->/117.html


      定制首選 果殼科技 咨詢熱線:0537-2551991

      關(guān)閉咨詢框