public IHttpActionResult PostScan([FromBody] string result) { try { result = HttpContext.Current.Request.Form["result"]; return(Json(ScanManage.ScanMethod(result))); } catch (Exception ex) { return(Json(ex.Message)); } }
public IHttpActionResult GetData() { try { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var data = ScanManage.GetData(); //string json = serializer.Serialize(data); //return json; return(Json(data)); } catch (Exception ex) { return(Json(new { err = ex.Message })); } }