2

テキスト ボックスで現在の URL (Web ブラウザで開いている URL) を取得するにはどうすればよいですか?

例えば:

webBrowser1.Url= new Uri("http://stackoverflow.com");

私のブラウザはリンクを開きました!!

テキストボックスにURL(http://stackoverflow.com)を取得したい

よろしく。

4

2 に答える 2

7
yourTextBox.Text = webBrowser1.Url.ToString();
于 2012-10-23T16:51:41.033 に答える
1
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;
于 2012-10-23T16:51:25.117 に答える