这有效,期待,我正在下载登录页面的字符串,而不是实际页面(url 变量)。
如何获取登录后页面的内容?
var credentials = new NetworkCredential { UserName = "xxxxxx", Password = "yyyyyy" };
using (var client = new WebClient())
{
client.Credentials = credentials;
string page = client.DownloadString(url);
if (page.Contains("cheetah"))
{
MessageBox.Show("cheetah exists");
}
else
{
MessageBox.Show("NOPE");
}
}