Imports System
Imports System.Net
Imports System.Drawing.Printing
Public Class frmBrowser
Public Structure Motor
Dim Name As String
Dim URL As String
End Structure
Public Structure Favorite
Dim Name, URL As String
End Structure
Public CurrentPage As Int16
Public LastAddress As Int16
Public Motors As New ArrayList
Public Forbiddens As New ArrayList
Public Favorites As New ArrayList
Public Shared Chronos As New ArrayList
Public ChronoEnabled As Boolean
Public Forbpassword As String
Public FavoritesFile As String = Application.StartupPath & "\Favorites.dat"
Public HomePageFile As String = Application.StartupPath & "\Settings.dat"
Public ChronosFile As String = Application.StartupPath + "\Chronos.dat"
Public HomePage As String
Public Iph As IPHostEntry
#Region "Metodi personalizzati"
#Region "Preferiti"
Public Sub AddFavorite(ByVal Fav As Favorite)
Favorites.Add(Fav)
FavoritesButton.DropDownItems.Add(Fav.Name)
FavoritesButton.DropDownItems(FavoritesButton.DropDownItems.Count - 1).Tag = Fav.URL
strRemove.DropDownItems.Add(Fav.Name)
End Sub
Public Sub DeleteFavorites(ByVal ToDel As String)
Dim F As Favorite
Dim i As Int16 = 0
For Each F In Favorites
If F.Name = ToDel Then
Favorites.RemoveAt(i)
Exit Sub
End If
i += 1
Next
End Sub
Public Sub RefreshFavorites()
Try
Dim F As Favorite
Dim i As Int16 = 0
FavoritesButton.DropDownItems.Clear()
strRemove.DropDownItems.Clear()
For Each F In Favorites
FavoritesButton.DropDownItems.Add(F.Name)
FavoritesButton.DropDownItems(i).Tag = F.URL
strRemove.DropDownItems.Add(F.Name)
i += 1
Next
Catch ex As IO.FileNotFoundException
CreateFile(FavoritesFile)
End Try
End Sub
Public Sub LoadFavorites()
Try
Dim R As New IO.StreamReader(FavoritesFile)
Dim F As Favorite
Dim I As Int16 = 0
While Not R.EndOfStream
F.Name = Decrypt(R.ReadLine)
F.URL = Decrypt(R.ReadLine)
FavoritesButton.DropDownItems.Add(F.Name)
FavoritesButton.DropDownItems(I).Tag = F.URL
strRemove.DropDownItems.Add(F.Name)
Favorites.Add(F)
I += 1
End While
R.Close()
R = Nothing
Catch ex As IO.FileNotFoundException
Dim WN As New IO.StreamWriter(FavoritesFile)
WN.Close()
WN = Nothing
End Try
End Sub
#End Region
#Region "Altro"
Public Function GetExtension(ByVal name As String) As String
Dim s As String = ""
Dim i, a As Int16
For i = 0 To name.Length - 1
If name.Chars(i) = "." Then
a = i + 1
End If
Next
For i = a To name.Length - 1
s = s & name.Chars(i)
Next
GetExtension = s
End Function
Public Function GetName(ByVal name As String) As String
Dim s As String = ""
Dim i, LastBS, LastDot As Int16
For i = 0 To name.Length - 1
If name.Chars(i) = "\" Then
LastBS = i + 1
End If
If name.Chars(i) = "." Then
LastDot = i
End If
Next
For i = LastBS To LastDot - 1
s = s & name.Chars(i)
Next
GetName = s
End Function
Public Sub ControlDownload()
If GetExtension(txtURL.Text) = "zip" Then
Dim down As New Web_Browser_2.frmDownload
down.lstDown.Items.Add(txtURL.Text)
down.DList(down.lstDown.Items.Count - 1).URL = txtURL.Text
down.DList(down.lstDown.Items.Count - 1).path = "C:\Documents and settings\Proprietario\Documenti\" & GetName(txtURL.Text) & "." & GetExtension(txtURL.Text)
down.Show()
End If
End Sub
Public Sub LoadMotors()
'Carica i motori di ricerca
Dim readh As IO.StreamReader
Dim M As Motor
Motors = New ArrayList
readh = New IO.StreamReader(Application.StartupPath & "\Motors.dat")
While Not ReadH.EndOfStream
M.Name = readh.ReadLine
M.URL = readh.ReadLine
Motors.Add(M)
IperSearch.DropDownItems.Add(M.Name)
End While
ReadH.Close()
ReadH = Nothing
End Sub
Public Sub LoadForbiddens()
'Carica i siti proibiti
Dim readh As IO.StreamReader
Dim M As String
Forbiddens = New ArrayList
readh = New IO.StreamReader(Application.StartupPath & "\Forbiddens.dat")
While Not readh.EndOfStream
M = Decrypt(readh.ReadLine)
Forbiddens.Add(M)
End While
readh.Close()
readh = Nothing
End Sub
Public Shared Sub AddForbidden(ByVal NewText As String)
Dim WTemp As New IO.StreamWriter("Temp.txt")
Dim RFile As New IO.StreamReader(Application.StartupPath + "\Forbiddens.dat")
While Not RFile.EndOfStream
WTemp.WriteLine(RFile.ReadLine)
End While
WTemp.Write(NewText)
WTemp.Close()
WTemp = Nothing
RFile.Close()
RFile = Nothing
FileCopy("Temp.txt", Application.StartupPath + "\Forbiddens.dat")
Kill("Temp.txt")
End Sub
Public Sub Append
(ByVal File As String,
ByVal NewText
As String)
Dim WTemp As New IO.StreamWriter("Temp.txt")
Dim RFile
As New IO.
StreamReader(File)
While Not RFile.EndOfStream
WTemp.WriteLine(RFile.ReadLine)
End While
WTemp.Write(NewText)
WTemp.Close()
WTemp = Nothing
RFile.Close()
RFile = Nothing
FileCopy("Temp.txt", Application.StartupPath + "\Forbiddens.dat")
Kill("Temp.txt")
End Sub
Public Function IsForbidden(ByVal Name As String) As Boolean
Dim F As String
For Each F In Forbiddens
If Name.StartsWith(F) Then
Return True
End If
Next
Return False
End Function
Public Function IsUrlForbidden() As Boolean
Return IsForbidden(txtURL.Text)
End Function
Public Sub CreateFile(ByVal Path As String)
Dim Wh As New IO.StreamWriter(Path)
Wh.Close()
Wh = Nothing
End Sub
Public Sub LoadChronos()
Dim R As New IO.StreamReader(ChronosFile)
Dim F As Favorite
Dim Count As Int16
While Not R.EndOfStream
F.Name = Decrypt(R.ReadLine)
F.URL = Decrypt(R.ReadLine)
Chronos.Add(F)
strChrono.DropDownItems.Add(F.Name)
strChrono.DropDownItems(Count).Tag = F.URL
Count += 1
End While
R.Close()
R = Nothing
End Sub
Public Sub AddChrono(ByVal F As Favorite)
Dim Count As Int16
Count = Chronos.Count
If Count > 0 Then
If Chronos(Count - 1).Name = F.Name Then
Exit Sub
End If
End If
If Count < LastAddress Then
Chronos.Add(F)
strChrono.DropDownItems.Add(F.Name)
strChrono.DropDownItems(Count).Tag = F.URL
Else
Chronos.RemoveAt(0)
Chronos.Add(F)
strChrono.DropDownItems.Add(F.Name)
strChrono.DropDownItems(Count).Tag = F.URL
End If
End Sub
Public Shared Sub RefreshChronos()
Dim F As Favorite
Dim Count As Int16
frmBrowser.strChrono.DropDownItems.Clear()
For Each F In Chronos
frmBrowser.strChrono.DropDownItems.Add(F.Name)
frmBrowser.strChrono.DropDownItems(Count).Tag = F.URL
Count += 1
Next
End Sub
Public Function Encrypt(ByVal S As String) As String
Dim I As Int64
Dim Cifra As Int16
Dim Temp As String = ""
For I = 0 To S.Length - 1
Cifra = Val(CType(I, String).Chars(CType(I, String).Length - 1))
If Asc(S.Chars(I)) + Cifra < 255 Then
Temp += Chr(Asc(S.Chars(I)) + Cifra)
Else
Temp += S.Chars(I)
End If
Next
Return Temp
End Function
Public Function Decrypt(ByVal S As String) As String
Dim I As Int64
Dim Cifra As Int16
Dim Temp As String = ""
For I = 0 To S.Length - 1
Cifra = Val(CType(I, String).Chars(CType(I, String).Length - 1))
If Asc(S.Chars(I)) - Cifra < 0 Then
Temp += S.Chars(I)
Else
Temp += Chr(Asc(S.Chars(I)) - Cifra)
End If
Next
Return Temp
End Function
#End Region
#End Region
Private Sub frmBrowser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim ReadH As New IO.StreamReader(Application.StartupPath & "\Settings.dat")
txtURL.Text = Decrypt(ReadH.ReadLine)
Forbpassword = Decrypt(ReadH.ReadLine)
ChronoEnabled = Decrypt(ReadH.ReadLine)
LastAddress = Decrypt(ReadH.ReadLine)
strActivate.Checked = ChronoEnabled
ReadH.Close()
ReadH = Nothing
'Carica l'HomePage
HomePage = txtURL.Text
WebBrowser.Navigate(New Uri(txtURL.Text))
'Carica i preferiti
LoadFavorites()
'Carica i motori di ricerca
LoadMotors()
'Carica i siti proibiti
LoadForbiddens()
If ChronoEnabled Then
'Carica la cronologia
LoadChronos()
strActivate.Text = "Attiva (max " & LastAddress & " url)"
Else
strChrono.DropDownItems.Add("[Cronologia disattivata]")
End If
Catch ex As IO.FileNotFoundException
Dim NewReadH As New IO.StreamWriter(HomePageFile)
NewReadH.WriteLine("http://www.pierotofy.it")
NewReadH.Close()
NewReadH = Nothing
WebBrowser.Navigate(New Uri("http://www.pierotofy.it"))
End Try
AddHandler FavoritesButton.DropDownItemClicked, AddressOf OpenFavorites
AddHandler strRemove.DropDownItemClicked, AddressOf FavoritesOption
AddHandler IperSearch.DropDownItemClicked, AddressOf ChargeMotor
AddHandler strChrono.DropDownItemClicked, AddressOf OpenChrono
End Sub
Private Sub ToolStripButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton9.Click, VaiToolStripMenuItem.Click
On Error Resume Next
If IsUrlForbidden() Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
Exit Sub
End If
WebBrowser.Navigate(New Uri(txtURL.Text))
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click, IndietroToolStripMenuItem.Click
On Error Resume Next
WebBrowser.GoBack()
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click, AvantiToolStripMenuItem.Click
On Error Resume Next
WebBrowser.GoForward()
End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click, AggiornaToolStripMenuItem.Click
On Error Resume Next
StatusLabel.Text = "Aggiornamento pagina"
WebBrowser.Refresh()
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click, InterrompiToolStripMenuItem.Click
On Error Resume Next
StatusLabel.Text = "Interruzione operazione"
WebBrowser.Stop()
End Sub
Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click, VisualizzaSorgenteToolStripMenuItem.Click
Dim source As New Source
source.ShowDialog()
End Sub
Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click, DownloadManagerToolStripMenuItem.Click
Shell(Application.StartupPath + "\DM\DownloadManager2.exe", AppWinStyle.NormalFocus)
End Sub
Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click, BugReportToolStripMenuItem.Click
WebBrowser.Navigate("http://www.pierotofy.it/pages/conctat/writeus.php?mail=nicolo1990@yahoo.it")
txtURL.Text = "http://www.pierotofy.it/pages/conctat/writeus.php?mail=nicolo1990@yahoo.it"
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
Dim About As New AboutBox1
About.ShowDialog()
End Sub
Private Sub AggiungiManulamenteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AggiungiManulamenteToolStripMenuItem.Click
Dim Name, URL As String
URL = InputBox("URL della pagina da aggiungere:", "Global Web")
If URL = Nothing Then
MsgBox("E' obbligatorio inserire un indirizzo!", MsgBoxStyle.Exclamation, "Global Web")
Exit Sub
End If
Name = InputBox("Nome dell'elemento da aggiungere ai Preferiti:", "Global Web")
If Name = Nothing Then
MsgBox("E' obbligatorio inserire un nome!", MsgBoxStyle.Exclamation, "Global Web")
Exit Sub
End If
Dim F As Favorite
F.Name = Name
F.URL = URL
AddFavorite(F)
End Sub
Private Sub AggiungiQuestaPaginaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AggiungiQuestaPaginaToolStripMenuItem.Click
Dim Name As String
StatusLabel.Text = "Aggiunta ai preferiti"
Name = InputBox("Nome dell'elemento da aggiungere ai Preferiti:", "Global Web", WebBrowser.Document.Title)
If Name = Nothing Then
MsgBox("E' obbligatorio inserire un nome!", MsgBoxStyle.Exclamation, "Global Web")
Exit Sub
End If
Dim F As Favorite
F.Name = Name
F.URL = txtURL.Text
AddFavorite(F)
StatusLabel.Text = WebBrowser.Document.Url.AbsolutePath
End Sub
Private Sub OpenFavorites(ByVal sender As Object, ByVal e As Windows.Forms.ToolStripItemClickedEventArgs)
txtURL.Text = e.ClickedItem.Tag
StatusLabel.Text = "Apertura pagina " & txtURL.Text & " in corso"
If IsUrlForbidden() Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
Exit Sub
End If
WebBrowser.Navigate(New Uri(txtURL.Text))
End Sub
Private Sub FavoritesOption(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles strRemove.DropDownItemClicked
If MsgBox("Eliminare questa voce?", MsgBoxStyle.Question + vbYesNo, "Eliminazione") = MsgBoxResult.Yes Then
DeleteFavorites(e.ClickedItem.Text)
RefreshFavorites()
End If
End Sub
Private Sub RimuoviTuttiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RimuoviTuttiToolStripMenuItem.Click
Kill(FavoritesFile)
CreateFile(FavoritesFile)
End Sub
Private Sub CambiaManualmenteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CambiaManualmenteToolStripMenuItem.Click
Dim S As String
S = InputBox("Nuova home page:")
If S <> Nothing Then
HomePage = S
End If
End Sub
Private Sub SettaQuestaPaginaComeHomePageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettaQuestaPaginaComeHomePageToolStripMenuItem.Click
If WebBrowser.Document.Url.AbsolutePath <> Nothing Then
HomePage = WebBrowser.Document.Url.AbsolutePath
End If
End Sub
Private Sub ToolStripButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton10.Click
On Error Resume Next
If IsForbidden(HomePage) Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
End If
WebBrowser.Navigate(New Uri(HomePage))
txtURL.Text = WebBrowser.Document.Url.AbsoluteUri
End Sub
Private Sub AttaccaIlSitoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AttaccaIlSitoToolStripMenuItem.Click, AttaccaIlSitoToolStripMenuItem1.Click
Dim Attacca As New Attacca
Attacca.ShowDialog()
End Sub
Private Sub RilevaIPToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RilevaIPToolStripMenuItem.Click, RilevaIPToolStripMenuItem1.Click
Try
Dim Iph As IPHostEntry
Iph = Dns.Resolve(WebBrowser.Url.Host)
MsgBox("L'Ip Del Sito " & WebBrowser.Url.Host & " è: " & Iph.AddressList(0).ToString, MsgBoxStyle.Information, "GLoBaL WeB - Show Ip")
Catch ex As System.NullReferenceException
MsgBox("Il sito deve ancora essere caricato. Attendere.", MsgBoxStyle.Exclamation, "Errore")
End Try
End Sub
Private Sub WebBrowser_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser.Navigating
StatusLabel.Text = "Apertura pagina " & e.Url.ToString & " in corso"
Me.Text = "Global Web"
ControlDownload()
End Sub
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
'Crea il file da stampare
Dim HTMLPage As New IO.StreamWriter("HTMLTemp.html")
HTMLPage.Write(WebBrowser.DocumentText)
HTMLPage.Close()
HTMLPage = Nothing
Dim Proc As New Process
Proc.StartInfo.FileName = "HTMLTemp.html"
Proc.StartInfo.Verb = "Print"
Proc.Start()
End Sub
Private Sub WebBrowser_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser.ProgressChanged
DownloadProgB.Visible = True
DownloadProgB.Value = e.CurrentProgress * 100 / e.MaximumProgress
If e.CurrentProgress = e.MaximumProgress Or e.CurrentProgress = 0 Then
DownloadProgB.Visible = False
End If
End Sub
Private Sub EseguiScansioneToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EseguiScansioneToolStripMenuItem.Click, EseguiScansioneToolStripMenuItem1.Click
Dim PortScan As New Portscan
PortScan.ShowDialog()
End Sub
Private Sub ToolStripButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton8.Click
WebBrowser.Navigate("http://www.insecurity.altervista.org/browser/anonymous.htm")
End Sub
Private Sub NavigazioneAnonimaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NavigazioneAnonimaToolStripMenuItem.Click
WebBrowser.Navigate("http://www.insecurity.altervista.org/browser/anonymous.htm")
End Sub
Private Sub ChargeMotor(ByVal sender As Object, ByVal e As Windows.Forms.ToolStripItemClickedEventArgs)
Dim M As Motor
For Each M In Motors
If M.Name = e.ClickedItem.Text Then
txtURL.Text = M.URL
WebBrowser.Navigate(M.URL)
Exit Sub
End If
Next
End Sub
Private Sub ToolStripButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim C As New ToolStripButton
C.Text = WebBrowser.DocumentTitle
C.Tag = txtURL.Text
End Sub
Private Sub BloccoDeiSitiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BloccoDeiSitiToolStripMenuItem.Click
Dim B As New Forbidden
B.ShowDialog()
End Sub
Private Sub txtURL_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtURL.KeyPress
If e.KeyChar = vbCrLf Then
On Error Resume Next
If IsUrlForbidden() Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
Exit Sub
End If
WebBrowser.Navigate(New Uri(txtURL.Text))
End If
End Sub
Private Sub txtURL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtURL.Click
txtURL.SelectionStart = 0
txtURL.SelectionLength = txtURL.Text.Length
End Sub
Private Sub txtURL_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtURL.DoubleClick
txtURL.SelectionLength = 0
txtURL.SelectionStart = txtURL.GetCharIndexFromPosition(MousePosition)
End Sub
Private Sub frmBrowser_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
'Salva tutti i siti proibiti
Dim W As New IO.StreamWriter(Application.StartupPath + "\Forbiddens.dat")
Dim S As String
For Each S In Forbiddens
W.WriteLine(Encrypt(S))
Next
W.Close()
W = Nothing
'Salva tutti i preferiti
Dim F As Favorite
W = New IO.StreamWriter(FavoritesFile)
For Each F In Favorites
W.WriteLine(Encrypt(F.Name))
W.WriteLine(Encrypt(F.URL))
Next
W.Close()
W = Nothing
'Salva la cronologia
W = New IO.StreamWriter(ChronosFile)
For Each F In Chronos
W.WriteLine(Encrypt(F.Name))
W.WriteLine(Encrypt(F.URL))
Next
W.Close()
W = Nothing
'Salva i settaggi generali
W = New IO.StreamWriter(HomePageFile)
W.WriteLine(Encrypt(HomePage))
If Forbpassword <> Nothing Then
W.WriteLine(Encrypt(Forbpassword))
End If
W.WriteLine(Encrypt(ChronoEnabled))
W.WriteLine(Encrypt(LastAddress))
W.Close()
W = Nothing
End Sub
Private Sub AttivaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles strActivate.Click
ChronoEnabled = strActivate.Checked
If Not ChronoEnabled Then
strChrono.DropDownItems.Clear()
strChrono.DropDownItems.Add("[Cronologia disattivata]")
Else
strChrono.DropDownItems.Clear()
RefreshChronos()
strActivate.Text = "Attiva (max " & LastAddress & " url)"
End If
End Sub
Private Sub MemorizzaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MemorizzaToolStripMenuItem.Click
LastAddress = InputBox("Inserire il numero massimo dei siti che verranno ricordati nella cronologia:")
End Sub
Private Sub OpenChrono(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)
On Error Resume Next
If IsForbidden(e.ClickedItem.Tag) Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
Exit Sub
End If
WebBrowser.Navigate(New Uri(e.ClickedItem.Tag))
End Sub
Private Sub WebBrowser_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser.DocumentCompleted
txtURL.Text = WebBrowser.Document.Url.ToString
StatusLabel.Text = "Pagina corrente: " + txtURL.Text
If ChronoEnabled = True Then
Dim F As Favorite
F.Name = WebBrowser.DocumentTitle
F.URL = txtURL.Text
AddChrono(F)
End If
WebBrowser.Focus()
If IsUrlForbidden() Then
MsgBox("Il sito appartiene alla categoria dei siti bloccati dal browser. Per modificare le impostazioni, vedere la voce Strumenti->Blocco dei siti.", MsgBoxStyle.Exclamation, "403 - Forbidden")
WebBrowser.Navigate(New Uri(HomePage))
End If
End Sub
Private Sub CancellaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancellaToolStripMenuItem.Click
Dim C As New fmrChrono
C.ShowDialog()
End Sub
End Class