| | |
Web browser with predermined par of URL
Please support our VB.NET advertiser: Intel Parallel Studio Home
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 |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





