Click here to Skip to main content
15,906,268 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to make a software app which reads through a websites source code and looks for javascript, odd or hidden coding which could be a threat to the user of the site.

I have the following code to read the source code and display it:

VB
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim pandora As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(TextBox1.Text)
        Dim response As System.Net.HttpWebResponse = pandora.GetResponse
        Dim braco22 As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream)
        Dim source As String = braco22.ReadToEnd

        TextBox2.Text = source

    End Sub
End Class


The displaying part will be removed later but how can I tell vb 2008 to look for javascripts and odd or hidden code as explained above?

If vb finds the specified code then it should bring up 'form2' else 'form3'

Any help much appreciated and thanks in advance to any helpers
Posted
Updated 19-Aug-10 0:40am
v2
Comments
Dalek Dave 19-Aug-10 6:40am    
Edited for Readability, Grammar and Code Block.

1 solution

Use regular expressions[^] to search for and isolate the fragments that you are searching for. The link should get you started.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900