我想添加 Cookie 并获取 http 网站源如何将 Cookie 添加到我的代码中,以及当 getresponse() 网站读取我的 Cookie 时?
enter code here
WebRequest scienceRequest = WebRequest.Create("http://www.google.com");
WebResponse scienceResponse = scienceRequest.GetResponse();
Stream ReceiveStream = scienceResponse.GetResponseStream();
scienceResponse = scienceRequest.GetResponse();
ReceiveStream = scienceResponse.GetResponseStream();
StreamReader readStream = new StreamReader(ReceiveStream, encode);
string strResponse = readStream.ReadToEnd();
readStream.Close();
scienceResponse.Close();