高手,高手,高分呀,快来一个小问题

夜若 2008-06-24 04:12:02
如果有很多连接,是连接像土豆网上的视频
可是有一个问题,土豆经常更新
连接少的时候可以一个个检查连接目标是不是存在
可是如果有几千个,或是更多,那么那些连接不存在了要更新

可不可以帮我写一段可以 检查连接是否存在 的代码
...全文
63 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Anlige 2008-06-24
  • 打赏
  • 举报
回复
下面函数调用~~

function GetResStr(URL)
dim ResBody,ResStr,PageCode,sta
Set Http=server.createobject("msxml2.serverxmlhttp.3.0")
Http.setTimeouts 10000, 10000, 10000, 10000
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
sta=Http.status
If sta=200 Then
GetResStr="页面正常"
elseif sta=404 Then
GetResStr="页面不存在"
elseif sta=500 then
GetResStr="URL服务器错误"
End If
End If
End Function

Anlige 2008-06-24
  • 打赏
  • 举报
回复
下面函数调用~~

function GetResStr(URL)
dim ResBody,ResStr,PageCode,sta
Set Http=server.createobject("msxml2.serverxmlhttp.3.0")
Http.setTimeouts 10000, 10000, 10000, 10000
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
sta=Http.status
If sta=200 Then
GetResStr="页面正常"
elseif sta=404 Then
GetResStr="页面不存在"
elseif sta=500 then
GetResStr="URL服务器错误"
End If
End If
End Function

学习a123456 2008-06-24
  • 打赏
  • 举报
回复
不学不行
jhwcd 2008-06-24
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 Anlige 的回复:]
可以试试xmlhttp组件~~~~
[/Quote]
Anlige 2008-06-24
  • 打赏
  • 举报
回复
下面函数调用~~

function GetResStr(URL)
dim ResBody,ResStr,PageCode,sta
Set Http=server.createobject("msxml2.serverxmlhttp.3.0")
Http.setTimeouts 10000, 10000, 10000, 10000
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
sta=Http.status
If sta=200 Then
GetResStr="页面正常"
elseif sta=404 Then
GetResStr="页面不存在"
elseif sta=500 then
GetResStr="URL服务器错误"
End If
End If
End Function

Anlige 2008-06-24
  • 打赏
  • 举报
回复
下面函数调用~~

function GetResStr(URL)
dim ResBody,ResStr,PageCode,sta
Set Http=server.createobject("msxml2.serverxmlhttp.3.0")
Http.setTimeouts 10000, 10000, 10000, 10000
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
sta=Http.status
If sta=200 Then
GetResStr="页面正常"
elseif sta=404 Then
GetResStr="页面不存在"
elseif sta=500 then
GetResStr="URL服务器错误"
End If
End If
End Function

Anlige 2008-06-24
  • 打赏
  • 举报
回复
下面函数调用~~

function GetResStr(URL)
dim ResBody,ResStr,PageCode,sta
Set Http=server.createobject("msxml2.serverxmlhttp.3.0")
Http.setTimeouts 10000, 10000, 10000, 10000
Http.open "GET",URL,False
Http.Send()
If Http.Readystate =4 Then
sta=Http.status
If sta=200 Then
GetResStr="页面正常"
elseif sta=404 Then
GetResStr="页面不存在"
elseif sta=500 then
GetResStr="URL服务器错误"
End If
End If
End Function

Dogfish 2008-06-24
  • 打赏
  • 举报
回复
用xmlhttp检测一下,是否返回404, 如果是404就是不存在。

Does a url exist?
Another simple use is finding if a url exists, in HTTP there are various status codes returned by both HEAD and GET requests, 200 means success, 404 means failure, and the others mean other things. See HTTP status codes for a full explanation. using the status property of the xmlhttp object provides you this status

xmlhttp.open("HEAD", "/faq/index.html",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200) alert("URL Exists!")
else if (xmlhttp.status==404) alert("URL doesn't exist!")
else alert("Status is "+xmlhttp.status)
}
}
xmlhttp.send(null)
Anlige 2008-06-24
  • 打赏
  • 举报
回复
可以试试xmlhttp组件~~~~
MATLAB中使用FFT做频谱分析时频率分辨率问题-频率分辨率.rar MATLAB中使用FFT做频谱分析时频率分辨率问题 最近做FFT时,使用的采样频率和信号长度的取舍一直没有搞清楚,后来在论坛上发了一个贴子《总结一下使用FFT和维纳-辛钦定理求解PSD问题》(讨论见https://www.ilovematlab.cn/thread-27150-1-1.html,特别感谢会员songzy41,他的问题给了我很大启示),跟帖中给了我不少启示,并且让我对“频率分辨率”这个概念有了更深入的理解。再次一并感谢论坛的高手们。 频率分辨率,顾名思义,就是将信号中两个靠的很近的频谱分开的能力。 信号x长度为Ts,通过傅氏变换后得到X,其频率分辨率为Δf=1/T(Hz),若经过采样后,假设采样频率为fs=1/Ts,而进行频谱分析时要将这个无穷长的序列使用窗函数截断处理,假设使用矩形窗,我们知道,矩形窗的频谱为sinc函数,主瓣宽度可以定义为2*pi/M,M为窗宽,那么,时域相乘相当于频域卷积,频域内,这一窗函数能够分辨出的最近频率肯定不可能小于2*pi/M了,也就是如果数据长度不能满足2*pi/M<|w2-w1|(w2,w1为两个靠的很近的频率),那么在频谱分析时,频谱上将不能分辨出这两个谱,由于w2-w1=2*pi/fs=2*pi*Δf/fs也就是2*pi/M<2*piΔf/fs,得到Δf的限制为fs/M,这就是窗函数宽度的最小选择,就是说,根据Shannon采样定理确定了采样频率后,要根据靠的最近的谱峰来确定最小的采样长度,这样,所作出来的频谱才能分辨出那两个谱峰,也就是拥有了相应的频率分辨率。 几个例子: 考虑双正弦信号:x = sin sin;根据Shannon采样定理,采样频率要大于截止频率的两倍,这里选采样频率为80,那么,我们可以看到,Δf为0.2Hz,那么,最小的数据长度为0.2/80=400,但是对正弦信号的频谱分析经验告诉我们,在截断时截断时的数据要包含整周期,并且后面不宜补零以避免频谱泄露(这一点见胡广书《数字信号处理导论》,清华大学出版社),那么,我们要选择至少980个点,才能保含到一个整周期,另外,FFT的经验告诉我们作分析时最好选择2的整数次幂,我们选择靠的最近的1024点。分析结束。 [CODE] Fs = 80; n = 0:1/Fs:1023*1/Fs; x = sin sin; N = length; figure; X = fftshift); plot*Fs/N,abs*2/N); grid on; axis; 这是按照我们的分析进行的编程和图形 zheng.jpg 可以看出这两个谱峰很好的被分辨开来,9.8Hz不在谱线上,所以幅值不为1,以下是一些对比: [CODE] Fs = 80; n = 0:1/Fs:1023*1/Fs; x = sin sin; N = length; X = fftshift); figure; subplot plot*Fs/N,abs*2/N); grid on; axis; title; n = 0:1/Fs:979*1/Fs; x = sin sin; N = length; X = fftshift); subplot plot*Fs/N,abs*2/N); grid on; axis; title; n = 0:1/Fs:399*1/Fs; x = sin sin; N = length; X = fftshift); figure; subplot plot*Fs/N,abs*2/N); grid on; axis; title; Fs = 20; n = 0:1/Fs:1024*1/Fs; x = sin sin; N = length; X = fftshift); subplot plot*Fs/N,abs*2/N); grid on; axis; title; 结果如下: 1024.jpg 400.jpg 这是我在做FFT以及论坛中的问题时所得到的一点启发,不当之处还请大家指正。OO~ 频率分辨率.rar 为了方便大家,我将doc版报告和m文件一起上传,和帖子内容一样。OO~

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧