首 页
网络学院
视频教程
资源下载
HOT
实例教程
图文教程
专题中心
学习社区
繁體中文
当前位置:
首页
>
图文教程
>
网络编程
>
ASP
> 两种小偷程序的比较
ASP
ASP实例代码:搞个长文章分页代码
说说对象的复制
多个函数验证同一表单
查询某个字段没有值的所有记录的SQL语句怎么写?
ASP实例:一个简单的ASP无组件上传类
ASP实例讲解:用分页符实现长文章分页显示
ASP实例:动态网页中常用的6个ASP程序
ASP实例:词语搭配游戏的制作
ASP实例学习:随机生成文件名的函数
asp实例:测试WEB服务器
ASP实例:计数器程序详解
预防ASP网站被黑 彻底了解ASP木马
分享:XML HTTP Request的属性和方法简介
ASP架设:给每个IIS站点建立一个用户
ASP技巧:判断远程图片是否存在
故障解决:解决ASP脚本运行超时的方法
再说ASP输出N行N列表格
怎么判断一个对象是否已被释放
ASP实现网页打开任何类型文件都保存的方法
ASP技巧:利用函数InstrRev()获取当前文件名
No.
«
‹
6
7
8
9
›
»
技术文章搜索
关键字
ASP 中的 两种小偷程序的比较
出处:
互联网
整理:
软晨网(RuanChen.com)
发布:
2009-09-13
浏览: 104 ::
收藏到网摘: n/a
ASP如何获取真实IP地址
使用xmlHttp结合ASP实现网页的异步调用
点击运行可以看到效果:
Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False .Send GetURL = bytes2bstr(.responsebody) '对取得信息进行验证,如果信息长度小于100则说明截取失败 if len(.responsebody)<100 then response.write "获取远程文件
"&url&"
失败。" response.end end if End With Set Retrieval = Nothing End Function ' 二进制转字符串,否则会出现乱码的! function bytes2bstr(vin) strreturn = "" for i = 1 to lenb(vin) thischarcode = ascb(midb(vin,i,1)) if thischarcode < &h80 then strreturn = strreturn & chr(thischarcode) else nextcharcode = ascb(midb(vin,i+1,1)) strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode)) i = i + 1 end if next bytes2bstr = strreturn end function function savetofile(bodyall,filename) dim objstream1 set objstream1=createobject("adodb.stream") objstream1.type=2 objstream1.open objstream1.position=objstream1.size objstream1.writetext bodyall objstream1.savetofile filename,2 objstream1.close set objstream1=nothing end function '声明截取的格式,从Start开始截取,到Last为结束 Function GetKey(HTML,Start,Last) filearray=split(HTML,Start) filearray2=split(filearray(1),Last) GetKey=filearray2(0) End Function url="http://www.86516.com" Html = GetURL(Url) savetofile html,"ce.htm"
[Ctrl+A 全选 提示:你可先修改部分代码,再按运行]
点击运行可以看到效果:
function gethttppage(url) dim http set http=createobject("MICROSOFT.XMLHTTP") http.open "GET",url,false http.send() if http.readystate<>4 then exit function end if gethttppage=bytestostr(http.responseBody,"GB2312") if err.number<>0 then err.clear end function function bytestostr(body,cset) dim objstream set objstream=createobject("adodb.stream") objstream.type=1 objstream.mode=3 objstream.open objstream.write body objstream.position=0 objstream.type=2 objstream.charset=cset bytestostr=objstream.readtext objstream.close set objstream=nothing end function function savetofile(bodyall,filename) dim objstream1 set objstream1=createobject("adodb.stream") objstream1.type=2 objstream1.open objstream1.position=objstream1.size objstream1.writetext bodyall objstream1.savetofile filename,2 objstream1.close set objstream1=nothing end function dim url,http url="http://www.86516.com" html=gethttppage(url) 'msgbox html savefilename="index1.htm" savetofile html,savefilename
[Ctrl+A 全选 提示:你可先修改部分代码,再按运行]
ASP如何获取真实IP地址
使用xmlHttp结合ASP实现网页的异步调用
评论 (0)
All
登陆
还没注册?