判断文件是否存在的函数

//判断文件是否存在的函数,
        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;
            }
        }
 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/sundnss/archive/2007/06/20/1660072.aspx

posted @ 2009-08-18 16:15  oraclejava  阅读(551)  评论(0)    收藏  举报