I am trying to get the current URL from an internet
explorer window using the string str = Request.RawUrl; and then put the output
into a text box on a form for later processing but I am getting an error saying
that the name request does not exist in the current context.
Am I missing something very obvious or am I going about this the wrong way?
Any advice would be greatly appreciated
Loading
Kirtan PatelPosted Dec 16, 2009, 8:35 AM
please check "do you like this answer" check box if it helps you :)
Step 1 :
Add Reference to Below Library
By Project Menu >> Add Reference like Shown in Image
Step 2:
add Following using Statement
using SHDocVw;
Step 3:
Code Like Below To Get Current URL of Internet Explore .
private void button1_Click(object sender, EventArgs e)
{
foreach (InternetExplorer ie in new ShellWindowsClass())
{
textBox1.Text = ie.LocationURL.ToString();
}}
CoderPosted Dec 18, 2009, 7:23 AM
Hi All,
Thanks for your input I have managed to get it to work now
Your advise is greatly appreciated
:-)
Hiren SoniPosted Dec 16, 2009, 8:13 AM
Srinivas KotraPosted Dec 16, 2009, 7:33 AM
"); Textbox.text = MyUrl }