FAQ: How to Open a URL or Send an E-Mail from a VB Application

Tuesday Dec 14th 2004 by Dimitris Nabermana
Share:

Open a URL or send an e-mail with a click of a button from within a VB application.

I tried for hours and hours to find a good, simple code to make it possible for me to open a URL or send an e-mail from a link edited in a TextBox and not assigned in a LinkLabel. The answer is very simple: Just add the following code to a click event in a button:

Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click
        System.Diagnostics.Process.Start(TextBox1.Text)
End Sub

The contents of the text box must be http://www.something.com or mailto:info@something.com. Your default browser or mail application will open and perform the requested action.

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved