MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides  
Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > Programming > Programming section > VB
Reload this Page [Guide] Web Browser Advanced
VB Discussions about VB programming

Reply
 
LinkBack Thread Tools
[Guide] Web Browser Advanced
(#1)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
Wow Guides [Guide] Web Browser Advanced - 03-19-2008

Now I saw the other thread posting how to make a simple web browser, but I felt like it needed more. So I'm going to show you how make a more advanced web browser, with more functions such as A back, forward, home, refresh button etc. This is done in Visual Basic 2008.

Sorry for the blue text being hard to read, all of this text is in the solution, which is easier to see, and can be compiled.

This is the whole solution, all the code, please don't edit and say you made this.

[Only registered and activated users can see links. ]



Virus scan:
Antivirus Version Last Update Result
AhnLab-V3 2008.3.22.1 2008.03.21 -
AntiVir 7.6.0.75 2008.03.22 -
Authentium 4.93.8 2008.03.22 -
Avast 4.7.1098.0 2008.03.23 -
AVG 7.5.0.516 2008.03.22 -
BitDefender 7.2 2008.03.23 -
CAT-QuickHeal 9.50 2008.03.21 -
ClamAV 0.92.1 2008.03.23 -
DrWeb 4.44.0.09170 2008.03.23 -
eSafe 7.0.15.0 2008.03.18 -
eTrust-Vet 31.3.5633 2008.03.21 -
Ewido 4.0 2008.03.23 -
F-Prot 4.4.2.54 2008.03.22 -
F-Secure 6.70.13260.0 2008.03.21 -
FileAdvisor 1 2008.03.23 -
Fortinet 3.14.0.0 2008.03.23 -
Ikarus T3.1.1.20 2008.03.23 -
Kaspersky 7.0.0.125 2008.03.23 -
McAfee 5257 2008.03.21 -
Microsoft 1.3301 2008.03.23 -
NOD32v2 2967 2008.03.21 -
Norman 5.80.02 2008.03.20 -
Panda 9.0.0.4 2008.03.23 -
Prevx1 V2 2008.03.23 -
Rising 20.36.62.00 2008.03.23 -
Sophos 4.27.0 2008.03.23 -
Sunbelt 3.0.978.0 2008.03.18 -
Symantec 10 2008.03.23 -
TheHacker 6.2.92.252 2008.03.22 -
VBA32 3.12.6.3 2008.03.21 -
VirusBuster 4.3.26:9 2008.03.22 -
Webwasher-Gateway 6.6.2 2008.03.23 -
Ok here is what each thing does:

THIS IS FOR THE MAIN FORM - FORM1

Public Class Form1


'This tells the webbrowser to navigate to whatever link you put in the search box
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

WebBrowser1.Navigate(TextBox1.Text)

End Sub

'This refreshes the page in the webbrowser if pressed
Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click

WebBrowser1.Refresh()

End Sub

'These are the functions that happen when the form loads
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Declares this form as form1 in the form library
myFormLibrary.Form1 = Me

'This navigates to google on start up
WebBrowser1.Navigate("Google.com")

'this clears the textbox on start up
ToolStripStatusLabel1.Text = ""

'this starts the timer that fills the status label
Timer1.Start()

End Sub

'This tells the webbrowser to go back one page if pressed
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click

WebBrowser1.GoBack()

End Sub

'Tells the webbrowser to go to the next page if pressed
Private Sub btnForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForward.Click

WebBrowser1.GoForward()

End Sub

'Shows the About me form if pressed
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click

Dim formabout As New FormAbout
formabout.Show()

End Sub

'Closes the program if the exit button in the menu is clicked
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click

Me.Close()

End Sub

'This is used to show the status text or the current link that your mouse is over in the toolstrip label
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

'this resets the progress bar if the Status Text is "Done" every timer tick
If ToolStripStatusLabel1.Text = "Done" Then
ToolStripProgressBar1.Value = 0
End If

'This shows the status text or the link your mouse is over every timer tick
ToolStripStatusLabel1.Text = WebBrowser1.StatusText

End Sub

'This takes the information from the textbox and searches it on google and displays it in the webbrowser
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

WebBrowser1.Navigate("http://www.google.com/search?hl=en&q=" + TextBox2.Text + "&btnG=Google+Search&aq=f")

End Sub

'Places the name of the current website in the url
Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated

'Changes the tab text to the host of the website
TabPage1.Text = WebBrowser1.Url.Host

'Changes the textbox to the current link
TextBox1.Text = WebBrowser1.Url.ToString

End Sub

'This will show a dialog to where you can save the page for offline use.
Private Sub SavePageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SavePageToolStripMenuItem.Click

WebBrowser1.ShowSaveAsDialog()

End Sub

'This will make the progress work
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged

ToolStripProgressBar1.PerformStep()
If ToolStripProgressBar1.Maximum = ToolStripProgressBar1.Value Then
ToolStripProgressBar1.Value = 0
End If

End Sub





'Important notes about the design -

'For the toolstripstatuslabel, set the spring property to true, and then set the text alignment to mid left

'For the tabcontrol1 set the anchors to all directions, this will cause it to stretch if the window is maximized

'The google search bar label, the text box after that and the button after that all have their anchors set to the top right,
'this will cause them to go to that part of the screen when maximized

'The screen is set to auto maximize on load


End Class

End of Main Form - Form1

This is for the Bookmarks form - frmBookmarks

'Imports to the form
Imports System.IO

Public Class frmBookmarks

'closes form on close button click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.Close()

End Sub

'shows list on form load
Private Sub frmBookmarks_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Declares this form as frmBookmarks in the myFormLibrary Class
myFormLibrary.frmBookmarks = Me

'Clears the listbox
Me.ListBox1.Items.Clear()

'Dims the file as a string
Dim file As String

'gets all the files in the directory
Dim files() As String = Directory.GetFiles("C:\Program Files\Web Browser Demo\Bookmarks\")

'for loop that adds the file location to the listbox as an item
For Each file In files

'adds to the listbox
Me.ListBox1.Items.Add(file)

Next

'Sorts the listbox
Me.ListBox1.Sorted = True

'Allows the listbox to be scrollable
ListBox1.ScrollAlwaysVisible = True

'Starts the refresh timer
Timer1.Start()
End Sub

'updates the list every timer tick
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'clears the list box so there is no file repetition when the names are placed in the listbox
Me.ListBox1.Items.Clear()


'Dims the file as a string
Dim file As String

'gets all the files in the directory
Dim files() As String = Directory.GetFiles("C:\Program Files\Web Browser Demo\Bookmarks\")

'for loop that adds the file location to the listbox as an item
For Each file In files
'adds to the listbox
Me.ListBox1.Items.Add(file)

Next

'Sorts the listbox
Me.ListBox1.Sorted = True

'Allows the listbox to be scrollable
ListBox1.ScrollAlwaysVisible = True

End Sub

'Stops timer if an item in the list is clicked
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

Timer1.Stop()

End Sub

'opens the file in the bookmarks tab of the main form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

'Dims the file name as a string
Dim FileName As String

'The file name is the selected listbox item
FileName = ListBox1.SelectedItem

'dims a new filestream to open the selected file
Dim fs As FileStream = File.OpenRead(FileName)

'dims a new reader to read the file
Dim sr As New StreamReader(fs)

'Reads all the text
Dim text As String = sr.ReadToEnd()

'Navigates to the bookmark in the webbrowser
Form1.WebBrowser1.Navigate(text)

'closes the bookmark form
Me.Close()
End Sub

'starts timer again if the form loses focus
Private Sub frmBookmarks_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
Timer1.Start()
End Sub

'Deletes the bookmark file if selected
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Dims the a string for a variable
Dim FileToDelete As String

'the file to be deleted is the selected listbox item
FileToDelete = ListBox1.SelectedItem

'if the file exists, then the file is deleted and a message box is show and then the item is removed from the list box
If System.IO.File.Exists(FileToDelete) = True Then

System.IO.File.Delete(FileToDelete)

MsgBox("File Deleted")

ListBox1.Items.Remove(ListBox1.SelectedItem)

End If
End Sub

'Closes the form if button is pressed
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Me.Close()

End Sub




'Important notes about the bookmarks, this program must be placed on the C drive for this to work correctly,
'this program must also have sufficient privileges so that it can create the bookmarks directory.

End Class

End of Bookmarks Form - frmBookmarks

That is all the code explained. If you need more assistance please let me know.

Last edited by The Maffyx; 03-23-2008 at 01:59 PM.. Reason: Updated Program - Edited Text
Reply With Quote

Donate to remove ads.
(#2)
Old
NineOneOne's Avatar
NineOneOne is Offline
Master Sergeant
Rep Power: 3
Reputation: 14
NineOneOne is on a distinguished road
 
Posts: 126
Join Date: Aug 2006
03-19-2008

nice (filler)


[Only registered and activated users can see links. ]
Reply With Quote
(#3)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
03-19-2008

Quote:
Originally Posted by NineOneOne View Post
nvm (filler)
I didn't really feel like going in and making it save to a file so I just set the home button to navigate to google.com.
Reply With Quote
(#4)
Old
NineOneOne's Avatar
NineOneOne is Offline
Master Sergeant
Rep Power: 3
Reputation: 14
NineOneOne is on a distinguished road
 
Posts: 126
Join Date: Aug 2006
03-19-2008

oh i see, great btw


[Only registered and activated users can see links. ]
Reply With Quote
(#5)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
03-19-2008

Quote:
Originally Posted by NineOneOne View Post
oh i see, great btw
Thanks ^_^ I'm surprised how much easier they have made things since the version I learned on (2003).
Reply With Quote
(#6)
Old
Ermok's Avatar
Ermok is Offline
Contributor
Rep Power: 3
Reputation: 212
Ermok has a spectacular aura aboutErmok has a spectacular aura aboutErmok has a spectacular aura about
 
Posts: 457
Join Date: Jul 2007
Location: Telford ;D
03-19-2008

So you are releasing the project file?
That isn't going ot help anyone understand the code.. I'll make a worthwhile one tonight :')


Reply With Quote
(#7)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
03-19-2008

Quote:
Originally Posted by Ermok View Post
So you are releasing the project file?
That isn't going ot help anyone understand the code.. I'll make a worthwhile one tonight :')
Yea everything is in that .rar the solution, which contains all the code, or are you asking for just the program itself? I'll write out what each thing in the code means later today.

Last edited by The Maffyx; 03-19-2008 at 08:37 AM..
Reply With Quote
(#8)
Old
Viter's Avatar
Viter is Offline
Member of The Month
Rep Power: 4
Reputation: 387
Viter is just really niceViter is just really niceViter is just really niceViter is just really nice
 
Posts: 1,691
Join Date: Aug 2007
Location: Denmark
03-19-2008

this isnt really a guide




Reply With Quote
(#9)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
03-19-2008

Quote:
Originally Posted by Viter Er Svedig View Post
this isnt really a guide
I'm going to edit it to show how to make it, I was just showing what it was to get the groundwork done.
Reply With Quote
(#10)
Old
Viter's Avatar
Viter is Offline
Member of The Month
Rep Power: 4
Reputation: 387
Viter is just really niceViter is just really niceViter is just really niceViter is just really nice
 
Posts: 1,691
Join Date: Aug 2007
Location: Denmark
03-19-2008

Quote:
Originally Posted by Maffyx View Post
I'm going to edit it to show how to make it, I was just showing what it was to get the groundwork done.
i just edited my thread so its advanced now
but btw nice web browser x2




Reply With Quote
(#11)
Old
The Maffyx is Offline
Lieutenant Commander
Rep Power: 2
Reputation: 67
The Maffyx will become famous soon enough
 
Posts: 668
Join Date: Feb 2007
03-19-2008

Quote:
Originally Posted by Viter Er Svedig View Post
i just edited my thread so its advanced now
but btw nice web browser x2
Thanks!(Filler)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361