foreach (ListViewItem list in listView1.Items) { bool respond = checkrequest(list.Text); if (respond == true) Do something...... else others...... }
public bool checkrequest(string url) { try { WebRequest webrequest =HttpWebRequest.Create(url); WebResponse webresponse; try { webresponse = (HttpWebResponse)webrequest.GetResponse(); } catch (Exception) { return false; } } catch { } return true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)