| | |
Web browser with predermined par of URL
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Jan 2008
Posts: 33
Reputation:
Solved Threads: 0
Hello! I have this simple Internet browser. It works “fine”, but I’d like part of the URL (most of it actually) to be predetermined (always same website, but different pages). For example, I want to be able to type only some middle part of the URL & then click "Go!" and be able to connect to particular webpage in same website.
Here is what I mean (just an example):
somesite.com/johnb/profile/info.html
somesite.com/steveu/profile/info.html
somesite.com/karenk/profile/info.html
somesite.com/michaelv/profile/info.html
Instead of typing all these URLs, I want in the text box to type either "johnb" or ""steveu" or "karenk" or "michaelv" or whatever name/text can be and then be able to click "Go" and the code to automatically include what needs to be before these names/text and after as anything before and after always stays the same.
This is my web browser code:
'************************************
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
Private Sub GoBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoBtn.Click
WebBrowser1.Url = New Uri(TextBox1.Text)
End Sub
End Class
'*************************************
Please help if you can. Thank you.
Here is what I mean (just an example):
somesite.com/johnb/profile/info.html
somesite.com/steveu/profile/info.html
somesite.com/karenk/profile/info.html
somesite.com/michaelv/profile/info.html
Instead of typing all these URLs, I want in the text box to type either "johnb" or ""steveu" or "karenk" or "michaelv" or whatever name/text can be and then be able to click "Go" and the code to automatically include what needs to be before these names/text and after as anything before and after always stays the same.
This is my web browser code:
'************************************
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
End Sub
Private Sub GoBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoBtn.Click
WebBrowser1.Url = New Uri(TextBox1.Text)
End Sub
End Class
'*************************************
Please help if you can. Thank you.
Last edited by leokuz; Mar 11th, 2008 at 7:25 pm.
•
•
Join Date: Feb 2008
Posts: 52
Reputation:
Solved Threads: 6
Change:
to:
I ran this pointing to a real website and it worked just fine.
visualbasic Syntax (Toggle Plain Text)
WebBrowser1.Url = New Uri(TextBox1.Text)
to:
visualbasic Syntax (Toggle Plain Text)
WebBrowser1.Url = New Uri("http://www.somesite.com/" & TextBox1.Text & "/profile/info.html")
I ran this pointing to a real website and it worked just fine.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Prime Number (Help Plz!)
- Next Thread: how to bring the items at list view to the another form
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic box button buttons center check code component connectionstring convert crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel fade file-dialog firewall folder ftp generatetags hardcopy image images input insert intel isnumericfuntioncall math monitor ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project reports" savedialog searchvb.net select serial shutdown string survey tcp temp temperature text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





