information from internet-explorer

  • Thread starter Thread starter milk-jam
  • Start date Start date
M

milk-jam

I'm trying to write a log which save each time internet explorer is opened
or closed

and all of the url which where visited?

Any help is greatly appreciated.
 
Hello

Just use the following line of code

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Your Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="iexplore")
{
// Log the Event, here u can get when the process
is started or closed
}
}
 
Thank Ali thats is very helpfull any idea on how to get the url
internet-explorer is visiting after the explorer is opened?
ALI RAZA said:
Hello

Just use the following line of code

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Your Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="iexplore")
{
// Log the Event, here u can get when the process
is started or closed
}
}


milk-jam said:
I'm trying to write a log which save each time internet explorer is
opened or closed

and all of the url which where visited?

Any help is greatly appreciated.
 
Hi milk,

We can use Microsoft Internet Control to get the reference of each IE
window and get information from these IE window. For more information,
please refer to the link below:
"Automating IE Remotely Using C#"
http://weblogs.asp.net/stevencohn/archive/2004/01/23/62117.aspx

Below is the source code for enumerating all the IE windows and make them
Full screen. Also, I have attached to the BeforeNavigate2 for a demo:
private void button1_Click(object sender, System.EventArgs e)
{
string filnam;

SHDocVw.ShellWindows shellWindows =
new SHDocVw.ShellWindowsClass();

foreach (SHDocVw.InternetExplorer ie
in shellWindows)
{
Console.WriteLine(ie.LocationURL);

filnam = System.IO.Path.GetFileNameWithoutExtension(
ie.FullName).ToLower();

if (filnam.Equals("iexplore"))
{
ie.BeforeNavigate2+=new
DWebBrowserEvents2_BeforeNavigate2EventHandler(ie_BeforeNavigate2);
ie.FullScreen=true;
}
}
}

private void ie_BeforeNavigate2(object pDisp, ref object URL, ref object
Flags, ref object TargetFrameName, ref object PostData, ref object Headers,
ref bool Cancel)
{
MessageBox.Show("IE navigating to another URL ");
}
Hope this helps.
=====================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi milk,

Does my reply make sense to you? Is your problem resolved? Please feel free
to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thank you very much for your reply sorry for the delay response i did not
notice you replied up until today.
Your soultion is not what im trying to achive. Your solution will return the
url of the control you created within your solution/project and i'm looking
to get the url from internet explorer which is not part of my application.
I think the way to do this is by adding a toolbar or a panel to Internet
explorer which will than send my appliction the url
I played with the registry and was able to add an icon to send the url to my
application. Im yet to find the way to add a pannel so that i might be bale
to include my application in that pannel and avoid loading my application
seperaly.

Any idea will be very helpfull
 
Hi milk,

Thanks for your feedback.

No, ShellWindowsClass can be used to enumerate all the shell windows in the
system, not only the IE window returned by my application. You can do some
test with my code snippet.

Also, if you really need the information regarding adding a toolbar/panel
to the IE window, we have to do COM interop with Shell interface to get
this done. Below are some sample articles:
"Extending Explorer with Band Objects using .NET and Windows Forms"
http://www.codeproject.com/csharp/dotnetbandobjects.asp
"Command Prompt Explorer Bar"
http://www.codeproject.com/csharp/commandbar.asp

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi,

I also want to do similar thing. But I don't want the details of all the
windows at one shot. I want the details of IE window as soon as IE
window is opened. So is there any event which gets fired when the IE
window is opened which I can capture in my program. My program will be a
Windows service.

Please let me know how it can be done.

Thanks in advance.

Sunil
 
Back
Top