/// <summary>
/// 调用RUL服务地址
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
private string ServiceInvoke()
{ string url =“​​http://www.***.com​​​”; //你需要访问的 web 地址
string result;
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url);
request.Timeout = 5000;
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
System.IO.Stream rStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(rStream, Encoding.UTF8); //如果内容乱码,试着修改 Encoding.UTF8 枚举
StringBuilder strBuilder = new StringBuilder();
strBuilder.Append(sr.ReadToEnd()); result = strBuilder.ToString();
return result;
}