使用外部用户服务时,发生以下错误。无法连接到远程服务器
无法连接到远程服务器
谁能能解释一下是哪里错了?有关使用外部Web服务的详细解释会有所帮助。
下面是我的一些代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.Serialization;
using System.Net;
using System.IO;
namespace sample_app
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
WebClient proxy = new WebClient();
byte[] abc = proxy.DownloadData((new Uri("http://www.webservicex.net/WS/CATs.aspx?CATID=12&DESC=Utilities")));
Stream strm = new MemoryStream(abc);
您是否更改了代码中实际实际URL的URL? –
嗨菲利普!网址与每个代码相同。 – suraj
啊,对不起,我认为这只是一个示例网址,现在我看到它的工作。 –