我有文本框(多行),我想将网络请求发送到所有链接以检查链接是否有效,如果不工作则错误消息
string strLink = TextBox1.Text;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(strLink);
objResponse = objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
strLink = sr.ReadToEnd();
sr.Close();
}
strLink = strLink.Replace("<form id='form1' method='post' action=''>", "");
strLink = strLink.Replace("</form>", "");
//strResult = strResult.Replace("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /><html xmlns="http://www.w3.org/1999/xhtml">");
div.InnerHtml = TextBox1.Text;