samedi 31 janvier 2015

Web Browser Filter

I would like to have a list of websites (each on a different line) that the web browser will check when navigated and if it is the current url then it will navigate back. Below is some code that I have currently have created and fails because it doesn't check each line of text and below that is some code that also check text with current text.



Using sr As New StreamReader("website_lists.txt")
Dim lined As String
lined = sr.ReadToEnd()
Dim scanbox As New TextBox
scanbox.Multiline = True
Dim buff As StringBuilder = New StringBuilder
For Each line In lined
If TextBox1.Text.Contains(scanbox.Text) Then
webview.GoBack()
MsgBox("Infected website! For your own sake stay away!")
End If
Next
End Using
End Sub


Some code that kinda does the same thing:



Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
Dim f As FileStream = New FileStream(ListBox1.SelectedItem, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
f = New FileStream(ListBox1.SelectedItem, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
md5.ComputeHash(f)
Dim hash As Byte() = md5.Hash
Dim buff As StringBuilder = New StringBuilder
Dim hashByte As Byte
For Each hashByte In hash
buff.Append(String.Format("{0:X2}", hashByte))
Next

If scanbox.Text.Contains(buff.ToString) Then


Have any suggestions or help? Thanks in advance.





Aucun commentaire:

Enregistrer un commentaire