1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

有人会用非常小偷吗?

本帖由 sunday62006-04-16 发布。版面名称:后端开发

  1. sunday6

    sunday6 New Member

    注册:
    2006-03-30
    帖子:
    19
    赞:
    0
    <%
    Server.ScriptTimeOut=9999999
    '----------------------------------------------------------------------------------------------------
    '
    ' 感谢你使用 非常小偷 !
    '
    ' 本代码完全公开和免费,你可以任意复制、传播、修改和使用,
    ' 但不得公开发表代码 不得用做商业用途,不得向其他使用者收费。
    '
    ' 使用时,请保留此段信息,谢谢配合
    '
    ' 非常小偷的网站:http://www.laoman.com/verythief/
    '
    '----------------------------------------------------------------------------------------------------
    Class Cls_Thief
    Private Value_
    Private Source_
    Private IsGet_
    Private Method_
    Private Input_

    Private objectStream,StringReturn
    Private objectHttp

    Private Sub Class_Initialize()
    Value_ = 0
    Source_ = "http://news.sina.com.cn/hotnews/"
    Method_ = "GET"
    IsGet_ = False
    End Sub

    Private Sub Class_Terminate()
    'statements
    End Sub

    Public Property Get Version
    Version = "VeryThief 20051006"
    End Property

    Public Property Let Source(ByVal vNewValue)
    Source_ = vNewValue
    End Property

    Public Property Let Method(ByVal vNewValue)
    If vNewValue <> "POST" Then vNewValue = "GET"
    Method_ = vNewValue
    End Property

    Public Property Let Input(ByVal vNewValue)
    Input_ = vNewValue
    End Property

    Public Property Get Value
    Value = Value_
    End Property

    Private Function Bytes2bStr(vin, Charset)
    On Error Resume Next
    Set objectStream = Server.CreateObject("ADODB.Stream")
    With objectStream
    .Type = 2
    .Mode = 3
    .Open
    .WriteText vin
    .Position = 0
    .Charset = Charset
    .Position = 2
    StringReturn = .ReadText
    .Close
    End With
    Set objectStream = Nothing
    Bytes2bStr = StringReturn
    End Function

    Public Sub Steal()
    If Source_ <> "" Then
    On Error Resume Next
    Set objectHttp=Server.CreateObject("MSXML2.XMLHTTP")
    objectHttp.Open Method_,Source_,False
    If Method_ = "POST" Then
    objectHttp.SetRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
    objectHttp.Send(Input_)
    Else
    objectHttp.Send()
    End If
    If objectHttp.ReadyState <> 4 Then
    Exit Sub
    End If
    Value_ = Bytes2bStr(objectHttp.ResponseBody,"gb2312")
    IsGet_ = True
    Set objectHttp = Nothing
    If Err.Number <> 0 Then Err.Clear
    Else
    Value_ = 0
    End If
    End Sub

    Public Sub noReturn()
    Value_ = Replace(Value_, vbCr, "")
    Value_ = Replace(Value_, vbLf, "")
    Value_ = Replace(Value_, vbTab, "")
    End Sub

    Public Function Change(code, OldString, NewString)
    Change = Replace(code, OldString, NewString)
    End Function

    Public Function Cut(code, head, bottom)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    Cut = Mid(code, InStr(code, head) + Len(head), InStr(code, bottom) - InStr(code, head) - Len(head))
    Else
    Cut = 0
    End If
    End Function

    Public Function CutX(code, head, bottom)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    CutX = Mid(code, InStr(code, head), InStr(code, bottom)- InStr(code, head)+ Len(bottom))
    Else
    CutX = 0
    End If
    End Function

    Public Function CutBy(code, head, headCusor, bottom, bottomCusor)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    CutBy = Mid(code, InStr(code, head) + Len(head) + headCusor, InStr(code, bottom) - 1 + bottomCusor - InStr(code, head) - Len(head) - headcusor)
    Else
    CutBy = 0
    End If
    End Function

    Public Function Filt(code, head, bottom, str)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    Filt = Replace(code, Mid(code, InStr(code, head) + Len(head), InStr(code, bottom) - InStr(code, head) - Len(head)), str)
    Else
    Filt = 0
    End If
    End Function

    Public Function FiltX(code, head, bottom, str)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    FiltX = Replace(code, Mid(code, InStr(code, head), InStr(code, bottom) - InStr(code, head) + Len(bottom)), str)
    Else
    FiltX = 0
    End If
    End Function

    Public Function FiltBy(code, head, headCusor, bottom, bottomCusor, str)
    If InStr(code, head) > 0 And InStr(code, bottom) > 0 Then
    FiltBy = Replace(code, Mid(code, InStr(code, head) + Len(head) + headCusor, InStr(code, bottom) - 1 + bottomCusor - InStr(code, head) - Len(head) - headcusor), str)
    Else
    FiltBy = 0
    End If
    End Function

    Public Function ReBuild(code, str)
    ReBuild= Replace(code, str, "<!--VeryThief-->")
    End Function

    Public Sub DeBug()
    Response.Write "<script language=""JavaScript"" type=""text/JavaScript"">"& vbNewLine
    Response.Write "<!--"& vbNewLine
    Response.Write "function Opera() {"& vbNewLine
    Response.Write vbTab & "var sourcecode=event.srcElement.parentElement.children[0].value;"& vbNewLine
    Response.Write vbTab & "var newwindow=window.open('','','');"& vbNewLine
    Response.Write vbTab & "newwindow.opener = null;"& vbNewLine
    Response.Write vbTab & "newwindow.document.write(sourcecode);"& vbNewLine
    Response.Write vbTab & "newwindow.document.close();"& vbNewLine
    Response.Write "}"& vbNewLine
    Response.Write "//-->"& vbNewLine
    Response.Write "</script>"& vbNewLine
    Response.Write "<textarea cols=""120"" rows=""32"" wrap=""VIRTUAL"">"& vbNewLine
    Response.Write HTMLEncode(Value_) & vbNewLine
    Response.Write "</textarea>"& vbNewLine
    Response.Write "<input type=""button"" onClick=""javascript:Opera();"" value=""Operate codes"">"
    End Sub

    Private Function HTMLEncode(String)
    If String = "" Or String = "0" Then : Exit Function
    String = Replace(String, "&", "&amp;")
    String = Replace(String, ">", "&gt;")
    String = Replace(String, "<", "&lt;")
    String = Replace(String, Chr(34), "&quot;")
    String = Replace(String, Chr(39), "&acute;")
    HTMLEncode = String
    End Function
    End Class
    %>

    我看不懂。。会用的教一下吧~
     
  2. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    PHP:
    <!--#include file="Thief.asp"-->
    <%
    Dim Thief
    Set Thief 
    = New Cls_Thief

    Thief
    .Method="GET"
    Thief.Source="http://www.chinahtml.com/index.shtml"
    Thief.Steal
    Thief
    .noReturn
    Thief
    .debug()

    Response.Write Thief.Version
    %>
    将你的代码保存Thief.asp,
    其实就是一个class,你看看上面那个,就明白咋回事了。
     
    #2 小叶, 2006-04-16
    最后编辑: 2006-04-16
  3. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    看看官方的手册吧。:lol:
     

    附件文件:

  4. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    PHP:
    <%
    Dim Thief,title,code
    Set Thief 
    = New Cls_Thief

    Thief
    .Method="GET"
    Thief.Source="http://www.chinahtml.com/index.shtml"
    Thief.Steal
    'Thief.noReturn
    '
    Thief.debug()

    code =Thief.value

    title 
    =Thief.Cut(code"<title>""</title>")
    Response.write title '获取标题
    '
    其他的方法一样

    %>
     
  5. sunday6

    sunday6 New Member

    注册:
    2006-03-30
    帖子:
    19
    赞:
    0
    你的代码非常中偷里没有啊,我就是官的代码看不懂。。。~

    谢谢再说具体点好吗/。
     
  6. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    还再具体,,我晕,你将你的代码保存为一个文件,用include 包含进来,其实它本身是一个class类文件,
    你就按照asp的类使用就可以实现了。

    第一步是定义使用类,
    Dim Thief,title,code
    Set Thief = New Cls_Thief

    接下来:

    Private Sub Class_Initialize()
    Value_ = 0
    Source_ = "http://news.sina.com.cn/hotnews/"
    Method_ = "GET"
    IsGet_ = False
    End Sub

    初始化有三个属性,你可以自己定义,
    Thief.Method="GET"
    Thief.Source="http://www.chinahtml.com/index.shtml"


    接着三方法
    Thief.Steal ’获取页面的值
    'Thief.noReturn '祛除空白行
    'Thief.debug() '使用debug调试看看,

    接下来获得返回值,
    code =Thief.value

    再下面就是普通的函数截取操作,
    手册说的很明白了。
     
  7. sunday6

    sunday6 New Member

    注册:
    2006-03-30
    帖子:
    19
    赞:
    0
    哦。。我再试试
     
  8. 1988dot

    1988dot New Member

    注册:
    2006-07-10
    帖子:
    1
    赞:
    0
    迷茫

    :mummy:
    我还是不很懂
    哪个大哥写详细点给我看看?
    拜托了