[問題] httpwebrequest
大家好:
最近手癢想寫個MLB的數據分析軟體,但是用httpwebrequest去抓www.mlb.com的字串時,
卻抓不到字串,但是以www.yahoo.com.tw為例,卻抓的到字串,目前尚未找出原因
請有過同樣情況的鄉民們解答 ^^
code
string Syslog;
string URL = "http://WWW.MLB.COM";
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(URL);
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream msgstream = myHttpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
StreamReader readStream = new StreamReader(msgstream, encode);
Syslog = readStream.ReadToEnd();
readStream.Close();
MessageBox.Show(Syslog);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.127.38.114
※ 編輯: MacPerson 來自: 122.127.38.114 (02/20 15:29)
→
02/20 16:09, , 1F
02/20 16:09, 1F
→
02/20 16:11, , 2F
02/20 16:11, 2F
→
02/20 17:12, , 3F
02/20 17:12, 3F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):