public void Visualize(Algorithm al, Dataset data) { string alPath = al.name;//算法已经编成dll 只需要知道名字就行 //MWArray readDataset(); //需要矩阵作为参数 }
//其实应该返回一个MWArray private void readDataset(Dataset data) { string dataPath = data.dir + data.name; //读取相应格式 }
public ActionResult UploadDataset(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); Dataset d = new Dataset { name = file.FileName, dir = path }; if (SaveDataset(d)) return Content("successfully uploaded. "); } return Content("upload failed. "); }
private bool SaveDataset(Dataset d) { bool success = false; if (ModelState.IsValid) { db.datas.Add(d); db.SaveChanges(); success = true; } return success; }