Set WshShell = CreateObject("WScript.Shell")
Run32()
Dim Winsock
Set Winsock = CreateObject("MSWinsock.Winsock")' //设置连接属性
Winsock.RemoteHost = "10.64.51.199" '//设置服务器地址
Winsock.RemotePort = 12345
'//设置服务器端口
Winsock.Connect()
'//连接服务器
dim str ,str2
str2="好呀好呀"
str="hello"
wscript.sleep 300
Winsock.Senddata str
wscript.sleep 300
'//发送数据到服务器
private Sub Winsock_DataArrival(bytes)
Dim receivedData
winsock.GetData receivedData, vbString
dim Str
str=receivedData
wscript.sleep 500
if str="我喜欢你,做我女朋友好吗?" Then
wscript.sleep 300
Winsock.Senddata str2
wscript.sleep 300‘注意发送信息前后要睡眠一会儿,等待信息发送
wshshell.run "音乐播放.vbs"
end if
end sub
do
winsock_dataarrival(100)
loop
Winsock.Close() '//关闭连接
Sub Run32()
'Author: Demon
'Date: 2015/7/9
'Website: http://demon.tw
Dim strComputer, objWMIService, colItems, objItem, strSystemType
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems
strSystemType = objItem.SystemType
Next
If InStr(strSystemType, "x64") > 0 Then
Dim fso, WshShell, strFullName
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
strFullName = WScript.FullName
If InStr(1, strFullName, "system32", 1) > 0 Then
strFullName = Replace(strFullName, "system32", "SysWOW64", 1, 1, 1)
WshShell.Run strFullName & " " &_
"""" & WScript.ScriptFullName & """", 10, False
WScript.Quit
End If
End If
End Sub