1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- '****************************特别说明****************************
- '* 1.使用Http方式连接到平台,请使用 server1.montnets.com:80
- '* 2.使用Http方式连接到服务器,必须使用所有以"Http"结尾的方法
- '****************************************************************
- ' On Error Resume Next '当程序出现意外错误时能继续执行
- Set myCom=Createobject("MWCom.clscom") '创建Com对象实例
- bTcpFlag=False
- 'bSendFlag=False
- bSendFlag=True
- 'bTcpFlag =True
- phones="13530504411,13304780001,13304780002,13304780003,13304780004,13304780005,13304780006,13304780007,13304780008,13304780009," _
- +"13304780010,13304780011,13304780012,13304780013,13304780014,13304780015,13304780016,13304780017,13304780018,13304780019," _
- +"13304780020,13304780021,13304780022,13304780023,13304780024,13304780025,13304780026,13304780027,13304780028,13304780029," _
- +"13304780030,13304780031,13304780032,13304780033,13304780034,13304780035,13304780036,13304780037,13304780038,13304780039," _
- +"13304780040,13304780041,13304780042,13304780043,13304780044,13304780045,13304780046,13304780047,13304780048,13304780049," _
- +"13304780050,13304780051,13304780052,13304780053,13304780054,13304780055,13304780056,13304780057,13304780058,13304780059," _
- +"13304780060,13304780061,13304780062,13304780063,13304780064,13304780065,13304780066,13304780067,13304780068,13304780069," _
- +"13304780070,13304780071,13304780072,13304780073,13304780074,13304780075,13304780076,13304780077,13304780078,13304780079," _
- +"13304780080,13304780081,13304780082,13304780083,13304780084,13304780085,13304780086,13304780087,13304780088,13304780089," _
- + "13304780090,13304780091,13304780092,13304780093,13304780094,13304780095,13304780096,13304780097,13304780098,13304780099"
- if bTcpFlag then
- 'clientsocket=myCom.MWConnect ("61.145.229.26",8018,"13811111111","123456") '连接短信平台
- 'clientsocket=myCom.MWConnect ("server1.montnets.com",8018,"13811111111","123456") '连接短信平台
- 'clientsocket=myCom.MWConnectSocks4Proxy("192.169.1.150",1080,"61.242.89.115",8018,"13600000***","******") '连接短信平台
- 'clientsocket=myCom.MWConnectSocks5Proxy("192.169.1.150",1080,"farlook","farlook","61.242.89.115",8018,"13600000***","******") '连接短信平台
-
- if clientsocket>0 then '连接成功
- if bSendFlag then
- 'sendret1=myCom.MWSendMsg("13534110346","恭喜发财,测试信息~~~, socket5 Com single") '发送单向信息
- 'sendret2=myCom.MWCsSendMsg("13534***346","恭喜发财,测试信息~~~",1) '发送客服信息
- sendret2=myCom.MWCsSendMsg(phones,"恭喜发财,测试信息,请不要发送出去。",100) '发送客服信息
- 'sendret3=myCom.MWVasSendMsg("13534***346","恭喜发财,测试信息~~~","121336", _
- ' "91600","00********","12145678",1) '发送增值信息
- end if
- Recvret=myCom.MWCsGetMsg() '读取客服信息
- ' Recvret=myCom.MWVasGetMsg() '读取增值信息
- 'If clientsocket>0 then
- ' reconn=myCom.MWReConnect() '重新连接
- 'else
- ' reconn=-1
- 'end if
- Readret=myCom.MWCsGetStatus() '读取发送状态报告
- myfee=myCom.MWQueryFee() '查帐号余额
- msgbox "发送单向信息结果" & sendret1
- 'msgbox "发送增值信息结果 & sendret3
- else
- msgbox "连接服务器失败,返回" & clientsocket
- end if
- else
- clientsocket=myCom.MWConnectHttp("server1.montnets.com",80,"13811111111","123456") '连接短信平台
- msgbox "连接成功" & clientsocket
- 'clientsocket=myCom.MWConnectHttp("61.145.229.26",80,"13811111111","123456") '连接短信平台
- 'clientsocket=myCom.MWConnectHttpProxy("192.169.1.150",808,"farlook","farlook","61.242.89.115",80,"13600000***","******") '连接短信平台
- if clientsocket>0 then '连接成功
- if bSendFlag then
- sendret2=myCom.MWCsSendMsgHttp(phones,"恭喜发财,测试信息~~~ http vbs",100) '发送客服信息
- msgbox "发送返回" & sendret2
- end if
- 'Recvret=myCom.MWCsGetMsgHttp() '读取客服信息
- 'If clientsocket>0 then
- ' reconn=myCom.MWReConnectHttp() '重新连接
- 'else
- ' reconn=-1
- 'end if
- 'Readret=myCom.MWCsGetStatusHttp() '读取发送状态报告
- 'myfee=myCom.MWQueryFeeHttp() '查帐号余额
- else
- msgbox "连接服务器失败,返回" & clientsocket
- end if
- end if
-
- if clientsocket>0 then
- myCom.MWDisConnect() '断开连接
- 'msgid=myCom.MWCsMsgID() '取得客服信息编号
- 'msgbox "发送客服信息结果" & sendret2
- 'msgbox "信息编号:" & msgid
- 'msgbox "连接句柄为:" & clientsocket
- 'msgbox "账户余额" & myfee
- 'msgbox Recvret & "个"
- for i=0 to Recvret-1 '显示所有的接收信息
- 'recmsg=myCom.MWGetRcvdMsg(i) '取得信息队列内容
- 'msgbox "第" & i+1 & "个用户信息:" & recmsg
- next
- 'msgbox "读取状态报告个数" & Readret & "个"
- for j=0 to Readret-1 '显示所有的状态报告
- 'statrep=myCom.MWGetStatRep(j) '取得状态报告队列内容
- 'msgbox "第" & j+1 & "个状态报告:" & statrep
- next
- end if
|