方法一:URL传参Get调用
使用HttpWebRequest,将参数Get调用
string HampsonURL = new BSysConfig().GetValue(ConfigKey.接口地址);
HampsonInfo Hmodel = new HampsonInfo();
Hmodel.cname = ePersonInfo.Name;
Hmodel.cmobile = ePersonInfo.Mobile;
Hmodel.cage = ePersonInfo.Age.ToString();
Hmodel.ccity = ePersonInfo.IntentCity;
Hmodel.user = "8a9ea098ac0079426ae3c722c8e48d0d";
string url = string.Format(@"{0}?user={1}&cname={2}&cmobile={3}&cage={4}&ccity={5}"
, HampsonURL, Hmodel.user, Hmodel.cname, Hmodel.cmobile, Hmodel.cage, Hmodel.ccity);
try
{
string resultCode = GetHttp(url, 100000);
switch (Convert.ToInt32(resultCode))
{
case 0:
result = "录入成功";
break;
case 1:
result = "此用户已存在";
break;
case 2:
result = "其他错误";
break;
default:
result = "文档木有写是啥错";
break;
}
&n

1万+

被折叠的 条评论
为什么被折叠?



