Hi Guys,

I have little problem to open any url link from my application i have placed a textbox and a button on the screen. what i want is any url which i write in the textbox and when i press the button automatically that url would open in the browser.

Kindly help me..

use this:

Dim p As New Process()

        p.StartInfo.FileName = TextBox1.Text    ' your url, ex:  "www.google.com"

        p.Start()

dont forget to imports:

Imports System.Diagnostics

dear sandeepparekh9 thanks for your reply i did the above code but it gives a win32exception "Application not found" what now ?

what was the input of textbox1 ??

try changing

p.StartInfo.FileName = TextBox1.Text

to

p.StartInfo.FileName = "www.google.com"

for testing..

above code works perfectly on my side...

nop ! dear same error "Application not found"

ok.. try changing

p.StartInfo.FileName = "notepad.exe"

it should start NotePad...

yes this works fine note pad is invoked but why url is not working!?

what's your default browser???

U want to open in webbrowser? or u want to show the webpage in winform?.

dear sandeep i have all 3 browsers firefox crome and ie installed i dnt know which one is on default and PGMER i want to show it on webbrowser.

codeorder when i am using above code it gives an arror "application not found"

try this:

Process.Start("IExplore.exe", "www.google.com")

if this does not work then you might have a virus issue, may be..

I agree with sandeepparekh9 . Try reinstalling your operating system.
This should not be an issue, especially since you have 3 different browsers installed.

Hmm Ok i am going to reinstall os hope its works .

Do let us know if you still have this issue after reinstalling. Good for references. :)

Yes sure i will. :)

Guys problem solved i didn't re install the OS just do this code

Process.Start("Chrome", "www.yahoo.com")

for chrome and if i use Process.Start("iexplorer", "www.yahoo.com") then it open in internet explorer it works fine now

Thanks ALL friends for help me...

i am glad its solved.. please mark the thread solved..

'Get Executable path (may also be FireFox.exe or any other browser
Dim sExePath as string = "C:\Program Files\Internet Explorer\iexplore.exe"
'Get URL to open, may be TextBox1.Text, or "www.google.com"
Dim sURL as string = TextBox1.Text 
'Start Process with URL as argument (Just like using command line argument to open URL)
Process.Start(sExePath, sURL)

Something like that? I made a similar program with this feature, except i have the option to use FireFox or Internet Explorer if the user selects which one they want. Thus, I include the executable path.


Doh! I didn't view the next page, someone already offered up this solution. Sorry.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.