PHP:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace EjercicioCS
{
public partial class WinnerForm : Form
{
public WinnerForm()
{
InitializeComponent();
}
StreamWriter sw = new StreamWriter(@"D:\pptptj.txt", true);
String [] result = new String [5];
int cont = 0;
private void btn_winner_MouseClick(object sender, MouseEventArgs e)
{
if (cont < 5)
{
result[cont] = txt_Ganador.Text+" "+lwin1.Text + "/" + lwin3.Text;
for (int x = 0; x <= cont; x++)
{
sw.WriteLine(result[x]);
}
}
sw.Close();
this.Hide();
cont++;
}
}
}
antes de hacer
PHP:
sw.Close();
PHP:
sw.Flush();
por el momento lo dejaria asi pero creo que te esta funcionando de milagro... porque me late que cada vez creas una nueva instancia del form, y por ende una nueva instancia del StreamWriter... de no ser así fallaria porque el StreamWriter lo cierras todas las veces...