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: leokuz is an unknown quantity at this point 
Solved Threads: 0
leokuz leokuz is offline Offline
Light Poster

Need Web Browser with Part the of URL Being Predermined

 
0
  #1
Mar 11th, 2008
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.
Last edited by leokuz; Mar 11th, 2008 at 7:25 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 52
Reputation: bwkeller is an unknown quantity at this point 
Solved Threads: 6
bwkeller bwkeller is offline Offline
Junior Poster in Training

Re: Web browser with predermined par of URL

 
1
  #2
Mar 11th, 2008
Change:

visualbasic Syntax (Toggle Plain Text)
  1. WebBrowser1.Url = New Uri(TextBox1.Text)

to:

visualbasic Syntax (Toggle Plain Text)
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 33
Reputation: leokuz is an unknown quantity at this point 
Solved Threads: 0
leokuz leokuz is offline Offline
Light Poster

Re: Web browser with predermined par of URL

 
0
  #3
Mar 12th, 2008
Thank you. That was perfect!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC