码迷,mamicode.com
首页 > 其他好文 > 详细

服务端获取内容

时间:2015-11-23 09:59:42      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

string iosUrl = "https://itunes.apple.com/cn/app/yi-hao-huo-che-tong-cheng/id946723843?mt=8";
string androidUrl = "http://www.yihaohuoche.com/download/";
string responseHtml = string.Empty;
if (DeviceType.IOS == type)
{
HttpWebRequest downloadRequest = (HttpWebRequest)WebRequest.Create(iosUrl);

HttpWebResponse downloadResponse = (HttpWebResponse)downloadRequest.GetResponse();
//从Internet资源返回数据流
Stream downloadStream = downloadResponse.GetResponseStream();
//读取数据流
StreamReader downloadStreamReader = new StreamReader(downloadStream, System.Text.Encoding.Default);
//读取数据
responseHtml = downloadStreamReader.ReadToEnd();
downloadStreamReader.Close();
downloadStream.Close();
downloadResponse.Close();

}

服务端获取内容

标签:

原文地址:http://www.cnblogs.com/liupeng61624/p/4987485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!