public static bool DataCheck(string RefNo, out string region)
{
region = "";
try
{
string url = "https://plugin.comapny.com/api/DataCheck";
using (var client = new WebClient())
{
Jobvalidation JVObj = new Jobvalidation();
JVObj.RefNo = RefNo.ToUpper();
JVObj.ConnectionString = Configration.DMSConfig.Connectionstring;
JVObj.Zone = Configration.DMSConfig.ZONE;
client.Headers.Add("Content-Type:application/json");
client.Headers.Add("Accept:application/json");
string result = client.UploadString(url, JsonConvert.SerializeObject(JVObj));
JVObj = JsonConvert.DeserializeObject<Jobvalidation>(result);
region = JVObj.region;
bool flag = Convert.ToBoolean(JVObj.flag);
return flag;
}
}
catch (Exception ex)
{
//string result;
region = "Exception:" + ex.Message;
return false;
}
}
当我们从本地计算机访问服务时,我们得到了以上错误。上面是我的代码,您可以为此进行检查和帮助吗?