您的位置:程序门 -> delphi -> 语言基础/算法/系统设计



如何判断这中   url     http://www.baidu.com/baidu.rar     是不是有效   


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如何判断这中 url http://www.baidu.com/baidu.rar 是不是有效
发表于:2008-01-10 12:03:54 楼主
如何判断这中       url           http://www.baidu.com/baidu.rar           是不是有效      
下面这个函数       是我写的           如果参数是           http://www.baidu.com       这个函数有效       但是参数是http://www.baidu.com/baidu.rar的时候这个函数       就没了效果谁能告诉我应该怎么改          
function       get(url:       string):       boolean;  
    var  
        idhttp:       tidhttp;  
        ss:       string;  
    begin  
        result:=       false;  
        idhttp:=       tidhttp.create(nil);  
        try  
                try  
                            idhttp.handleredirects:=       true;               //必须支持重定向否则可能出错9c       ?$m       g7z       y       {0k       m       o  
                        idhttp.readtimeout:=       30000;                           //超过这个时间则不再访问  
                            ss:=       idhttp.get(url);  
                            if       idhttp.responsecode=200       then  
                                result       :=true;  
                except  
                end;  
        finally  
                idhttp.free;  
        end;  
    end;  
   
function       get(url:       string):       boolean;  
    var  
        idhttp:       tidhttp;  
        ss:       string;  
    begin  
        result:=       false;  
        idhttp:=       tidhttp.create(nil);  
        try  
                try  
                            idhttp.handleredirects:=       true;               //必须支持重定向否则可能出错9c       ?$m       g7z       y       {0k       m       o  
                        idhttp.readtimeout:=       30000;                           //超过这个时间则不再访问  
                            ss:=       idhttp.get(url);  
                            if       idhttp.responsecode=200       then  
                                result       :=true;  
                except  
                end;  
        finally  
                idhttp.free;  
        end;  
    end;


快速检索

最新资讯
热门点击