0

以下错误开始突然出现!它在应用程序部署到服务器上后工作了几个月,但突然停止工作并显示以下错误。

我使用的代码如下:

private void PostData()
{
  c.Add("publicid", "xxxxxxxxxxxxxxxxxxxxxx");
  c.Add("name", "ABC");
  c.Add("label:Affiliate_ID", "207");
  c.Add("website", "websitename.com");
  c.Add("label:IP_Address", Request.ServerVariables["REMOTE_ADDR"]);
  c.Add("firstname", txtFirstName.Text.Trim());
  c.Add("phone", txtPhone.Text.Trim());
  c.Add("lastname", txtLastName.Text.Trim());
  c.Add("email", txtEmail.Text.Trim());
  c.Add("label:Date_of_Birth", String.Format("{0:YYYY-MM-DD}", Convert.ToDateTime(txtDob.Text.Trim())));
  c.Add("lane", txtStreetAddress.Text.Trim());
  c.Add("code", txtZip.Text.Trim());
  c.Add("city", txtCity.Text.Trim());
  c.Add("Province", txtProvince.Text.Trim());
  c.Add("label:Time_At_Address", stay.ToString(CultureInfo.InvariantCulture));
  c.Add("label:Known_Credit_Issues", "yes");
  c.Add("label:Net_Monthly_Income", txtMothlyIncome.Text.Trim());
  c.Add("label:Occupation", txtOccopation.Text.Trim());
  c.Add("label:Employer_Name", txtEmployer.Text.Trim());
  c.Add("label:Employment_Length", "");
  c.Add("label:Bankruptcy", "No");
  c.Add("label:Employer_Phone_Number", "");
  c.Add("label:Employer_Postal_Code", "");
  c.Add("label:Employer_Province", "");
  c.Add("label:Employer_City", "");
  c.Add("label:Employer_Address", "");

  var myWebClient = new System.Net.WebClient();
  const string postingUrl = "https://xxxx.com/modules/Webforms/capture.php";

  byte[] responseArray = null;
  responseArray = myWebClient.UploadValues(postingUrl, "POST", c);
  var responseData = Encoding.ASCII.GetString(responseArray);
}

在此处输入图像描述

请帮忙!这是一个实时应用程序:(

提前致谢。

4

1 回答 1

0

我将在黑暗中拍摄并说已在您的服务器上设置了系统范围的代理,并且由于WebClient实例默认使用该代理,因此它现在失败了。

后:

var myWebClient = new System.Net.WebClient();

添加:

myWebClient.Proxy = null;

重新编译/重新启动应用程序,让我知道我的巫毒调试感觉是正确的还是完全的 BS。

于 2015-08-30T06:06:15.097 回答