Reputation: 73
How can i get the current url (the opened url in web browser) in a text box ?
for example:
webBrowser1.Url= new Uri("http://stackoverflow.com");
and my browser opened the link !!
Now I want to get the url (http://stackoverflow.com) in a text box
regards.
Upvotes: 2
Views: 19260
Reputation: 5600
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;
Upvotes: 1