/// <summary> /// 添加设备 /// </summary> /// <param name="context"></param> /// <returns></returns> private string addMac(HttpContext context) { Json jsonResult = new Json(); string macNum = context.Request["macNum"]; string macAddress = context.Request["macAddress"]; int result = ms.addMac(macNum, macAddress); if (result > 0) { jsonResult.Success = true; jsonResult.Msg = "添加成功"; } else { jsonResult.Success = false; jsonResult.Msg = "添加失败"; } string strJson = JsonConvert.SerializeObject(jsonResult); return(strJson); }