Beispiel #1
0
 public static string SaveNetwork(string caminho)
 {
     if (network != null)
     {
         //var path = Path.Combine(@"C:\", "network" + DateTime.Now.Ticks + ".mlp");
         var fs      = new FileStream(caminho, FileMode.CreateNew, FileAccess.Write);
         var persist = new PersistBasicNetwork();
         persist.Save(fs, network);
         fs.Close();
         return(caminho);
     }
     return("");
 }
Beispiel #2
0
 public static void LoadNetwork(string nomeArquivo)
 {
     try
     {
         var fs      = new FileStream(nomeArquivo, FileMode.Open, FileAccess.Read);
         var persist = new PersistBasicNetwork();
         network = (BasicNetwork)persist.Read(fs);
         fs.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }