By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,013 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,013 IT Pros & Developers. It's quick & easy.

Opening a browser from vb.net from

P: n/a
Hi ,
I am in need of opening a new IE browser with an URL from my windows
form, coded in vb.net.
I tried with the following code.
Dim psi As New ProcessStartInfo
psi.FileName = "iexplore"
psi.Arguments = "http://www.google.com"
Process.Start(psi)

it worked initially. But now I recieve the error
"The application failed to initialize properly (0xc000007b)."
It works for anyother appication like notepad, mspaint, winword etc...
but shows error for iexplore alone!

Please help me in achieving this...
Regards
Vignesh

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Vigneshwaran,

Default browser
\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = "http://www.google.com"
p.StartInfo = pi
p.Start()
///
Nov 21 '05 #2

P: n/a
Hi Cor,
Thanks for ur response again.

I tried as u said, But still recieving the following error

An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll

Additional information: The system cannot find the file specified

Any suggestions please?

Thanks,
Vignesh

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #3

P: n/a
Vignashwaran,

I tried it on a new form, it shows a browser with a Google page.

Therefore, why not try it in a new project.

cor
Nov 21 '05 #4

P: n/a
Thanks Cor,
It worked for me too in a new project!
But what I need is to add a button in a form of an existing application
cliking which a new browser should start with a given URL.

Any suggessions for this scenario please...

Regards
Vignesh

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #5

P: n/a
Vignesh,

This is standard, put a button on your form, click on that there will be a
buttonclick event created and in that you place this code.

I have the idea that I miss something from the problem

Cor
Nov 21 '05 #6

P: n/a
Hi Cor,
Thats where iam getting error.
If i write the same code in the button click event, iam getting the error
that i mentioned so far...

Thanks,
Vignesh

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #7

P: n/a
Vignesh,

Like this,
\\\
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = "http://www.google.com"
p.StartInfo = pi
p.Start()
End Sub
///
This I cutted from a program that I tried, therefore you understand probably
already that it showed a browser.

I hope this helps,
Cor
Nov 21 '05 #8

P: n/a
"Vigneshwaran G via DotNetMonster.com" <fo***@DotNetMonster.com> schrieb:
I am in need of opening a new IE browser with an URL from my windows
form, coded in vb.net.
I tried with the following code.
Dim psi As New ProcessStartInfo
psi.FileName = "iexplore"
psi.Arguments = "http://www.google.com"
Process.Start(psi)

it worked initially. But now I recieve the error
"The application failed to initialize properly (0xc000007b)."
It works for anyother appication like notepad, mspaint, winword etc...
but shows error for iexplore alone!


Any reason for opening the file in IE explicitly? If there is no certain
reason for doing that, I'd let the OS pick the default browser to open the
document:

Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.