VB 2008中搜索特定的代码? [英] vb 2008 searching for specific code?

查看:71
本文介绍了VB 2008中搜索特定的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试制作一个软件应用程序,该应用程序可读取网站的源代码并查找可能对网站用户构成威胁的javascript,奇数或隐藏编码.

我有以下代码可阅读并显示源代码:

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:

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



显示部分将在以后删除,但是如何告诉vb 2008如上所述查找javascript和奇数或隐藏代码?

如果vb找到指定的代码,则应调出"form2",否则调出"form3"

非常感谢任何帮助,并感谢任何帮助者的帮助.



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

推荐答案

使用正则表达式 [ ^ ]进行搜索并隔离您要搜索的片段.链接应该可以帮助您入门.
Use regular expressions[^] to search for and isolate the fragments that you are searching for. The link should get you started.


这篇关于VB 2008中搜索特定的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆