home *** CD-ROM | disk | FTP | other *** search
-
- Function Main
-
- Dim SocketObject As Object
- Dim i As Integer
- Dim send As String
- Dim recv As Variant
- Dim result As Boolean
- Dim regexp As Object
-
- result = false
- ip = getparameter("ComputerIP")
- port = "110"
- cr = Chr(13) + Chr(10)
- rem _ip
- Socket.SetTimeout 7000,5000
- Set regexp = CreateObject("Vbscript.regexp")
- Set SocketObject = Socket.OpenTCP (ip,port)
- If Not SocketObject is Nothing Then
-
- recv = SocketObject.recv(1024)
-
- send="AUTH " + makeString(2048, "x") + cr
-
-
- SocketObject.Send(send)
-
- recv = SocketObject.recv(1024)
-
- If VarType(recv)<>8 Then
- main = true
- Exit Function
- End If
-
- send="USER " + makeString(1024, "x") + cr
- SocketObject.Send(send)
-
- recv = SocketObject.recv(1024)
- If VarType(recv)<>8 Then
- main = true
- Exit Function
- End If
-
-
- send="PASS " + makeString(1024, "x") + cr
- SocketObject.Send(send)
-
- recv = SocketObject.recv(1024)
-
- If VarType(recv)<>8 Then
- main = true
- Exit Function
- End If
-
-
- SocketObject.Close
- End If
-
- main = result
-
- End Function
-
-
- Function makeString(length As Integer, pattern As String) As String
- Dim tmpString As String
-
- Do While Len(tmpString) < length
- If Len(tmpString+pattern) <= length Then
- tmpstring= tmpString + pattern
- Else
- tmpstring = tmpString + Left(pattern, length - Len(tmpString))
- End If
- Loop
-
- makeString = tmpString
- End Function