[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
有两处改了一下,否则不能获取返回值...
  1. '发送飞信
  2. 'mobile 对方手机号
  3. 'message 发送内容
  4. Public Function SendMsg(mobile, message)
  5. If message = "" Then Exit Function
  6. If mobile = [$mobile] Then
  7. SendMsg = ToMyself(message)
  8. Else
  9. uid = GetUid(mobile)
  10. If uid <> -1 Then SendMsg = ToUid(uid, message, False)
  11. End If
  12. End Function
  13. '发送短信
  14. 'mobile 对方手机号
  15. 'message 发送内容
  16. Public Function SendShortMsg(mobile, message)
  17. If message = "" Then Exit Function
  18. If mobile = [$mobile] Then
  19. SendShortMsg = ToMyself(message)
  20. Else
  21. uid = GetUid(mobile)
  22. If uid <> -1 Then SendShortMsg = ToUid(uid, message, True)
  23. End If
  24. End Function
复制代码
示例程序改成:
  1. '示例程序:
  2. '设置默认值
  3. myphone="$phone"
  4. mypwd="$pwd"
  5. yourphone=myphone
  6. msgtoyou="Hello Fetion"
  7. shortmsgtoyou=msgtoyou
  8. successmsg="发送成功"
  9. ' 初始对象
  10. Set fetion = New VBSFetion
  11. '登陆飞信
  12. If fetion.Init(myphone, mypwd) Then
  13. 'fetion.ToMyself msgtoyou ' 发给自己?
  14. ' 发送飞信
  15. SendMsg=fetion.SendMsg(yourphone, msgtoyou)
  16. ' 发送短信
  17. SendShortMsg=fetion.SendShortMsg(yourphone, shortmsgtoyou)
  18. '返回消息
  19. If InStr(SendMsg, successmsg) Then : msgbox "飞信发送成功" : else : msgbox SendMsg : end if
  20. If InStr(SendShortMsg, successmsg) Then : msgbox "短信发送成功" : else : msgbox SendShortMsg : end if
  21. else
  22. msgbox "飞信用户名或密码错误,登录失败退出."
  23. End If
复制代码

TOP

返回列表