テキスト ボックスで現在の URL (Web ブラウザで開いている URL) を取得するにはどうすればよいですか?
例えば:
webBrowser1.Url= new Uri("http://stackoverflow.com");
私のブラウザはリンクを開きました!!
テキストボックスにURL(http://stackoverflow.com)を取得したい
よろしく。
テキスト ボックスで現在の URL (Web ブラウザで開いている URL) を取得するにはどうすればよいですか?
例えば:
webBrowser1.Url= new Uri("http://stackoverflow.com");
私のブラウザはリンクを開きました!!
テキストボックスにURL(http://stackoverflow.com)を取得したい
よろしく。
yourTextBox.Text = webBrowser1.Url.ToString();
Result : http://localhost:1302/TESTERS/Default6.aspx
string url = HttpContext.Current.Request.Url.AbsoluteUri;
result : /TESTERS/Default6.aspx
string path = HttpContext.Current.Request.Url.AbsolutePath;
result : localhost
string host = HttpContext.Current.Request.Url.Host;