判断文件是否存在的函数

//判断文件是否存在的函数,
        private bool Test(string URL)
        {
            try
            {
                System.Net.WebRequest s=System.Net.WebRequest.Create(URL);
                s.Timeout=10000;//响应时间
                System.Net.WebResponse a=s.GetResponse();
                return true;
            }
            catch
            {
                return false;
            }
        }
posted on 2008-01-18 16:27  Ameng  阅读(313)  评论(0编辑  收藏  举报