日期:2014-05-17 浏览次数:20932 次
public static List<int> GetHttp (string httpUrl) { List<int> result = new List<int>(); HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create (httpUrl); myReq.Method = "GET"; try { HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse (); System.IO.Stream myStream = HttpWResp.GetResponseStream (); int data = -1; while ((data = myStream.ReadByte()) != -1) { // 因为不清楚 myStream.Length 是否真实字节流长度. 所以用了动态数组List result.Add(data); } } catch (Exception exp) { Debug.Log(exp.ToString()); } return result ; }