string requestUri = string.Format("http://images.google.com/images?q={0}&ndsp={1}&start={2}&filter={3}&safe={4}",query,RESULTS_PER_QUERY.ToString(),(startPosition+i).ToString(), (filterSimilarResults)?"1":"0",safeSearchStr);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUri);
string resultPage = string.Empty;
using (HttpWebResponse httpWebResponse = (HttpWebResponse)request.GetResponse())
{
using (Stream responseStream = httpWebResponse.GetResponseStream())
{
using (StreamReader reader = new StreamReader(responseStream))
{
resultPage = reader.ReadToEnd();
}
}
}
以上是我的代码,我在下面遇到问题。
responseStream.Length as 'responseStream.Length'抛出类型'System.NotSupportedException'的异常
responseStream.Position as 'responseStream.Position'抛出了'System.NotSupportedException'类型的异常