导航

杭州网站建设专家-兆合信息

兆合信息技术 构建品质网站

« Visual Studio Team System 2008 Team Suite 下载和升级(注册)如何在Td中让图片和文字对齐 »

asp利用飞信api发送飞信

  1. '调用时,只需使用call 语句即可格式为:  
  2. '-----call sendsms(用户名,密码,发送到,短信内容)  
  3. function sendsms(u,p,s,m)   
  4. if len(u)=0 or len(p)=0 or len(s)=0 or len(m)=0 then   
  5. sendsms = flash   
  6. else   
  7. smsapi="http://sms.api.bz/fetion.php?username="& u &"&password="& p &"&sendto="& s &"&message="& m &""  
  8. smsgg= getHTTPPage(smsapi)   
  9. if smsgg="短信已提交到发送队列!"then   
  10. sendsms=true   
  11. else   
  12. sendsms=flash   
  13. end if   
  14. end if   
  15. end function   
  16.   
  17. OnErrorResumeNext  
  18. Server.ScriptTimeOut=9999999   
  19. FunctiongetHTTPPage(Path)   
  20. t = GETBody(Path)   
  21.            
  22. Endfunction   
  23. '上面的常用函数'首先.进行小偷程序的一些初始化设置.以上代码的作用分别是忽略掉所有非致命性错误.把小偷程序的运行超时时间设置得很长.这样不会出现运行超时的错误.  
  24.   
  25. '---------------------------------盗窃开始设置---------------------------------------------  
  26.   
  27. '1、下面是经典的小偷核发心源码.输入url目标网页地址.返回值getHTTPPage是目标网页的代码  
  28. function getHTTPPage(url)   
  29. dim Http   
  30. set Http=server.createobject("Microsoft.XMLHTTP")   
  31. Http.open"GET",url,false   
  32. Http.send()   
  33. if Http.readystate<>4 then   
  34. exit function   
  35. end if   
  36. getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")'注意WAP网页用utf-8,WEB用gb2312  
  37. set http=nothing   
  38. if err.number<>0 then err.Clear   
  39. end function   
  40.   
  41. '------------------------------------------------------------------------------------------  
  42.   
  43. '2、转换乱玛.直接用xmlhttp调用有中文字符的网页得到的将是乱玛.可以通过adodb.stream组件进行转换  
  44. FunctionBytesToBstr(body,Cset)   
  45. dim objstream   
  46. set objstream = Server.CreateObject("adodb.stream")   
  47. objstream.Type = 1   
  48. objstream.Mode =3   
  49. objstream.Open   
  50. objstream.Write body   
  51. objstream.Position = 0   
  52. objstream.Type = 2   
  53. objstream.Charset = Cset   
  54. BytesToBstr = objstream.ReadText   
  55. objstream.Close   
  56. set objstream = nothing   
  57. EndFunction  
  58. %>  

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新评论及回复

最近发表

Powered By HZZHIT

Copyright 2008-2009 杭州兆合信息技术有限公司. All Rights Reserved.