public void Visualize(Algorithm al, Dataset data) { string alPath = al.name;//算法已经编成dll 只需要知道名字就行 //MWArray readDataset(); //需要矩阵作为参数 }
public ActionResult UploadAlgorithm(HttpPostedFileBase up) { var file = Request.Files[0]; if (file != null && file.ContentLength > 0) { string path = Constants.serverPath; string filename = Request.Files[0].FileName; file.SaveAs(path + filename); Algorithm a = new Algorithm {name = file.FileName, dir = path}; if(SaveAlgorithm(a)) return Content("successfully uploaded. "); } return Content("upload failed. "); }
//保存到数据库 private bool SaveAlgorithm(Algorithm a) { bool success = false; if (ModelState.IsValid) { db.als.Add(a); db.SaveChanges(); success = true; } return success; }