无法将HttpWebRequest转换为HttpWebRequest这怎么回事啊?哪位大哥指定下

C语言 码拜 9年前 (2015-05-11) 1663次浏览 0个评论

public string GethtmlCode(string uri)
 {
string tempGethtmlCode = null;
try
{
HttpWebRequest htmlr = HttpWebRequest.Create(uri);
htmlr.CookieContainer = new CookieContainer();
htmlr.CookieContainer.Add(new Uri(uri), QQCookie);
htmlr.UserAgent = “Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)”;
HttpWebResponse htmlc = htmlr.GetResponse();
IO.Stream stram = htmlc.GetResponseStream();
StreamReader readStream = new StreamReader(stram, System.Text.Encoding.UTF8);
tempGethtmlCode = readStream.ReadToEnd();
readStream.Close();
htmlc.Close();
}

40分
你题目是啥。。。他们都是一样的还要转啥。。
要转换,那就强制转换
PS:你这个是java吧。
无法将HttpWebRequest转换为HttpWebRequest这怎么回事啊?哪位大哥指定下
是啊我也纳闷啊一样的还提示要转换啥原因啊C#的

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明无法将HttpWebRequest转换为HttpWebRequest这怎么回事啊?哪位大哥指定下
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!