open a new browser window in Windows Forms

  • Thread starter Thread starter VR
  • Start date Start date
V

VR

Hi,

How can I open a web site in a new browser window from a
regular windows form? (not an ASP.NET)

Do I have to use a COM ActiveX control or is there
anything like that already built in in .NET?

Thanks,
VR
 
I ran across that problem awhile back and the microsoft knowledge base
didn't exactly help me:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;305703

They suggest:

System.Diagnostics.Process.Start("http://www.google.com/index.html");

But that doesn't work for me (some kindof registry problem I guess).
This does work:
System.Diagnostics.Process.Start("z:\index.html");

So my computer knows what to do with .html files, there's something
about it being on a drive vs. http that is screwing it up.

This will open a web page in a new window of internet explorer, as
long as IE is installed on the client.:
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.StartInfo.FileName = "iexplore";
proc.StartInfo.Arguments = "http://www.google.com/";
proc.Start();

I guess you can use either or both, depending upon what you expect the
client machines to look like.

HTH,
mike
 
Hi,

You can add the Microsoft Internet Control 1.1 reference to your
application, then you can use it like this:

SHDocVw.InternetExplorerClass ie=new SHDocVw.InternetExplorerClass ();
Object vHeaders = null;
Object vPost = null;
Object vTarget = null;
Object vFlags = null;
ie.Navigate("http://www.google.com",ref vFlags,ref vTarget,ref vPost,ref
vHeaders);
ie.Visible =true;

Hope this helps.

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.

--------------------
| Content-Class: urn:content-classes:message
| From: "VR" <[email protected]>
| Sender: "VR" <[email protected]>
| Subject: open a new browser window in Windows Forms
| Date: Wed, 6 Aug 2003 22:49:02 -0700
| Lines: 10
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcp5rf0BZ5eyx/RSa8lDKB5Azu0g==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:174768
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| How can I open a web site in a new browser window from a
| regular windows form? (not an ASP.NET)
|
| Do I have to use a COM ActiveX control or is there
| anything like that already built in in .NET?
|
| Thanks,
| VR
|
 
Hi,

For more information, you can visit:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q305703

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.

--------------------
| Content-Class: urn:content-classes:message
| From: "VR" <[email protected]>
| Sender: "VR" <[email protected]>
| Subject: open a new browser window in Windows Forms
| Date: Wed, 6 Aug 2003 22:49:02 -0700
| Lines: 10
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcp5rf0BZ5eyx/RSa8lDKB5Azu0g==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:174768
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| How can I open a web site in a new browser window from a
| regular windows form? (not an ASP.NET)
|
| Do I have to use a COM ActiveX control or is there
| anything like that already built in in .NET?
|
| Thanks,
| VR
|
 
Thanks, Dmitriy.

-----Original Message-----
I ran across that problem awhile back and the microsoft knowledge base
didn't exactly help me:
http://support.microsoft.com/default.aspx?scid=kb;EN- US;305703

They suggest:

System.Diagnostics.Process.Start ("http://www.google.com/index.html");

But that doesn't work for me (some kindof registry problem I guess).
This does work:
System.Diagnostics.Process.Start ("z:\index.html");

So my computer knows what to do with .html files, there's something
about it being on a drive vs. http that is screwing it up.

This will open a web page in a new window of internet explorer, as
long as IE is installed on the client.:
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.StartInfo.FileName = "iexplore";
proc.StartInfo.Arguments = "http://www.google.com/";
proc.Start();

I guess you can use either or both, depending upon what you expect the
client machines to look like.

HTH,
mike





.
 
Back
Top