Everytime opening a new browser window

G

Guest

Hi everybody,

I am using a LinkLabel control to in a VB.NETwindows application to visit
web pages, and I am using

System.Diagnostics.Process.Start("http://www.microsoft.com")

Using this line of code I am unable to open the web pages in different web
browser, that is if, one browser window is opened with the
"www.microsoft.com" link, then the following instruction

System.Diagnostics.Process.Start("http://www.google.com")
will open google, in the same browser window, where microsoft.com was opened
previously,

Can anybody help me to open different browser window for different URL using
System.Diagnostics.Process.Start(URL) and LinkLabel?

Thanks
 
G

Guest

I believe there is a setting in Internet Explorer which causes it to reuse an
existing browser window. It has nothing to do with Process.Start.

HTH, Jakob.
 
W

William DePalo [MVP VC++]

Kajol said:
Can anybody help me to open different browser window for different URL
using
System.Diagnostics.Process.Start(URL) and LinkLabel?

Thanks

IE takes a string argument of "new" on the command line as a signal to open
up a new window. This C# hack below demonstrates that.

Regards,
Will

using System;
using System.Diagnostics;

namespace MySample
{
class MyTest
{
[STAThread]
static void Main(string[] args)
{
ProcessStartInfo info;

info = new ProcessStartInfo("iexplore.exe", "-new
http://www.microsoft.com");
System.Diagnostics.Process.Start(info);

info = new ProcessStartInfo("iexplore.exe", "-new
http://msdn.microsoft.com");
System.Diagnostics.Process.Start(info);
}
}
}
 
G

Guest

Thanks William DePalo, it worked for me.

William DePalo said:
Kajol said:
Can anybody help me to open different browser window for different URL
using
System.Diagnostics.Process.Start(URL) and LinkLabel?

Thanks

IE takes a string argument of "new" on the command line as a signal to open
up a new window. This C# hack below demonstrates that.

Regards,
Will

using System;
using System.Diagnostics;

namespace MySample
{
class MyTest
{
[STAThread]
static void Main(string[] args)
{
ProcessStartInfo info;

info = new ProcessStartInfo("iexplore.exe", "-new
http://www.microsoft.com");
System.Diagnostics.Process.Start(info);

info = new ProcessStartInfo("iexplore.exe", "-new
http://msdn.microsoft.com");
System.Diagnostics.Process.Start(info);
}
}
}
 
G

Guest

Nice - I did not know that.

/Jakob


William DePalo said:
Kajol said:
Can anybody help me to open different browser window for different URL
using
System.Diagnostics.Process.Start(URL) and LinkLabel?

Thanks

IE takes a string argument of "new" on the command line as a signal to open
up a new window. This C# hack below demonstrates that.

Regards,
Will

using System;
using System.Diagnostics;

namespace MySample
{
class MyTest
{
[STAThread]
static void Main(string[] args)
{
ProcessStartInfo info;

info = new ProcessStartInfo("iexplore.exe", "-new
http://www.microsoft.com");
System.Diagnostics.Process.Start(info);

info = new ProcessStartInfo("iexplore.exe", "-new
http://msdn.microsoft.com");
System.Diagnostics.Process.Start(info);
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top