cHTTP.cls
资源名称:HackIMUT.rar [点击查看]
上传用户:mfksglq
上传日期:2010-03-23
资源大小:3k
文件大小:3k
源码类别:
弱点检测代码
开发平台:
Visual Basic
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "cHTTP"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Private objXMLHTTP As New ServerXMLHTTP
- Public Function QueryData(ByVal sid As String, ByVal spass As String)
- Dim time1 As Integer
- Dim k As String
- strFormData = "username=" & sid & "&password=" & spass & "&utype=1"
- With objXMLHTTP
- .abort
- .open "POST", "http://202.207.16.59/servlet/javabbs.jwlogin?tag=login", False
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .setRequestHeader "Connection", "Keep-Alive"
- .setRequestHeader "Cookie", "0"
- .send strFormData
- 'DoEvents
- Do
- If .readyState = 4 Then
- ss = .responseText
- If sta = 0 Then
- If InStr(ss, "密码") > 0 Then
- QueryData = "密码错误"
- Exit Function
- End If
- If Not InStr(ss, "loginok.jsp") > 0 Then
- QueryData = "未知错误"
- Exit Function
- End If
- .open "GET", "http://202.207.16.59/jw/jw_student/wdkc/xk.jsp", False
- .send
- sta = 1
- Else
- info = Mid(ss, InStr(ss, "选课人"), 35)
- If InStr(ss, "<td height=""20"" width=""18%""><a href=""kchchx_xx.jsp?pcourseid") > 0 Then
- ss = Split(ss, "<td height=""20"" width=""18%""><a href=""kchchx_xx.jsp?pcourseid")(1)
- ss = Split(ss, "class=""middle_a"">")(1)
- ss = Split(ss, "</a></td>")(0)
- Else
- ss = "未选课"
- End If
- QueryData = Trim(Replace(info, vbCrLf, "")) & "=" & ss
- Exit Function
- End If
- End If
- Sleep (100)
- time1 = time1 + 1
- Loop Until time1 > 50
- QueryData = "超时"
- End With
- End Function
- Public Function Stas() As Integer
- Stas = objXMLHTTP.readyState
- End Function