예제 #1
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (listView1.Items.Count > 0)
     {
         if (File.Exists(pathReadAnWrite))
         {
             File.Delete(pathReadAnWrite);
         }
         string addString = "";
         for (int column = 0; column < listView1.Items.Count; column++)
         {
             for (int row = 0; row < listView1.Items[column].SubItems.Count; row++)
             {
                 addString += listView1.Items[column].SubItems[row].Text + "?";
             }
         }
         addString = addString.TrimEnd('?');
         addString = addString.ToUpper();
         try
         {
             generalMethods callToMethod = new generalMethods();
             callToMethod.writeInFiles(pathReadAnWrite, addString);
             MessageBox.Show("GUARDADDO CORRECTAMENTE");
         }
         catch (Exception)
         {
             MessageBox.Show("ERROR AL GUARDAR");
         }
     }
     else
     {
         MessageBox.Show("NO SE GUARDARA, NO EXISTEN DATOS");
     }
 }