本帖最后由 zldfsz 于 2013-7-10 17:46 编辑
5#的代码发现网址有&时生成的短网址出错,请用下面代码
$url=InputBox("请输入一个网址","请输入一个网址",'http://www.autoitx.com/forum.php?mod=redirect&goto=findpost&pid=436688&ptid=32304')
Dim $WinHttp
$url=StringReplace($url,"&","%26")
$WinHttp = ObjCreate("Microsoft.XMLHTTP")
$WinHttp.Open('post',"http://dwz.cn/create.php", False)
$WinHttp.setRequestHeader("Pragma", "no-cache")
$WinHttp.setRequestHeader("Cache-Control", "no-cache")
$WinHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$WinHttp.Send('url='&$url)
If Not StringInStr($WinHttp.responseText,'"status":0') Then Exit MsgBox(4096, "提示","提交的网址有误")
$tinyurl=StringRegExpReplace($WinHttp.responseText, '.*\\/(.*?)".*',"$1")
If MsgBox(4097, "单击确定按钮复制短网址","http://dwz.cn/"&$tinyurl)=1 Then ClipPut("http://dwz.cn/"&$tinyurl)
|