问题
This is more a task to ask than help but... after 1 day of tries I can't get it work. This is my code
private string _InetReadEx(string sUrl)
{
HttpWebRequest webReq = (HttpWebRequest)HttpWebRequest.Create(sUrl);
try
{
webReq.CookieContainer = new CookieContainer();
webReq.Method = "GET";
using (WebResponse response = webReq.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
StreamReader reader = new StreamReader(stream);
aRet = reader.ReadToEnd();
return aRet;
}
}
}
catch (Exception ex)
{
return ex.Message;
}
}
What this code does is simple. It returns the source of a server. So here is my silly question; how can I do something similar on C# windows phone(windows phone 8.1/8)?
Thank you in advance, Maria
来源:https://stackoverflow.com/questions/32029261/c-sharp-windows-to-c-sharp-phone-windows