最近闲来无事,自己重绘了一下窗体
//获取远程服务器上的文本文件
string txtContent = Get("https://sit323sa.blob.core.windows.net/at2/TestA.txt");
}
private string Get(string strURL)
{
HttpWebRequest request;
// 创建一个HTTP请求
request = (HttpWebRequest)WebRequest.Create(strURL);
HttpWebResponse response;
response = (HttpWebResponse)request.GetResponse();
System.IO.StreamReader myreader = new System.IO.StreamReader(response.GetResponseStream(), Encoding.UTF8);
string responseText = myreader.ReadToEnd();
myreader.Close();
return responseText;
}