如何用C#实现自动判断链接已失效(链接所指网站已不存在),望高手给出实现代码。
------解决方案--------------------------------------------------------
- C# code
try { WebClient wc = new WebClient(); Stream db = wc.OpenRead(url); } catch (Exception ex) { //出错表示链接错误,做相应的处理 }