コード例 #1
0
 protected void save_Click(object sender, EventArgs e)
 {
     if (robotFile1.HasFile)
     {
         string file1 = Server.MapPath("~/Files/") + robotFile1.FileName;
         if (System.IO.File.Exists(file1))
             System.IO.File.Delete(file1);
         robotFile1.SaveAs(file1);
         Robot robot = new Robot();
         robot.LoadFromXml(file1);
         if (robot.Rounds != null && robot.Rounds.Count > 0)
         {
             if (robot.VerifyUniqueRobot())
                 robot.SaveInDB();
         }
         System.IO.File.Delete(file1);
     }
 }