public static void saveMasaleh(ClassAnbar choob, ClassAnbar ahan, bool flagChoob) { if ((choob != null) && (ahan != null)) { StreamWriter writer = new StreamWriter(pathMasaleh); writer.WriteLine( choob.person + " , " + choob.ghayegh + " , " + choob.anbar + " , " ); writer.WriteLine( ahan.person + " , " + ahan.ghayegh + " , " + ahan.anbar + " , " ); writer.Close(); } if (flagChoob) { Debug.Log("ok"); Debug.Log(choob.person + " , " + choob.ghayegh + " , " + choob.anbar + " , "); editLine(choob.person + " , " + choob.ghayegh + " , " + choob.anbar + " , ", pathMasaleh, 1); } if (!flagChoob) { editLine(ahan.person + " , " + ahan.ghayegh + " , " + ahan.anbar + " , ", pathMasaleh, 2); } }
private void getMasaleh() { choob = new ClassAnbar(); ahan = new ClassAnbar(); StreamReader reader = new StreamReader(pathMasaleh); string line; string[] stringArry; line = reader.ReadLine(); stringArry = line.Split(','); choob.person = int.Parse(stringArry[0]); choob.ghayegh = int.Parse(stringArry[1]); choob.anbar = int.Parse(stringArry[2]); line = reader.ReadLine(); stringArry = line.Split(','); ahan.person = int.Parse(stringArry[0]); ahan.ghayegh = int.Parse(stringArry[1]); ahan.anbar = int.Parse(stringArry[2]); reader.Close(); }