有两处改了一下,否则不能获取返回值...- '发送飞信
- 'mobile 对方手机号
- 'message 发送内容
- Public Function SendMsg(mobile, message)
- If message = "" Then Exit Function
- If mobile = [$mobile] Then
- SendMsg = ToMyself(message)
- Else
- uid = GetUid(mobile)
- If uid <> -1 Then SendMsg = ToUid(uid, message, False)
- End If
- End Function
-
- '发送短信
- 'mobile 对方手机号
- 'message 发送内容
- Public Function SendShortMsg(mobile, message)
- If message = "" Then Exit Function
- If mobile = [$mobile] Then
- SendShortMsg = ToMyself(message)
- Else
- uid = GetUid(mobile)
- If uid <> -1 Then SendShortMsg = ToUid(uid, message, True)
- End If
- End Function
复制代码 示例程序改成:- '示例程序:
- '设置默认值
- myphone="$phone"
- mypwd="$pwd"
- yourphone=myphone
- msgtoyou="Hello Fetion"
- shortmsgtoyou=msgtoyou
- successmsg="发送成功"
-
- ' 初始对象
- Set fetion = New VBSFetion
- '登陆飞信
- If fetion.Init(myphone, mypwd) Then
- 'fetion.ToMyself msgtoyou ' 发给自己?
- ' 发送飞信
- SendMsg=fetion.SendMsg(yourphone, msgtoyou)
- ' 发送短信
- SendShortMsg=fetion.SendShortMsg(yourphone, shortmsgtoyou)
- '返回消息
- If InStr(SendMsg, successmsg) Then : msgbox "飞信发送成功" : else : msgbox SendMsg : end if
- If InStr(SendShortMsg, successmsg) Then : msgbox "短信发送成功" : else : msgbox SendShortMsg : end if
- else
- msgbox "飞信用户名或密码错误,登录失败退出."
- End If
复制代码
|