Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/06/2010, 22:51
art12
 
Fecha de Ingreso: junio-2010
Mensajes: 7
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Contador en Visual c++

int cont=0;
array<String^>^palabras;
while( linea= sr->ReadLine())
{

palabras = linea->Split(':');

if(this->textBox2->Text==palabras[2])
{
var=1;

}

}

sr->Close();
if(var==1){
MessageBox::Show("El Alias ya existe, escribe otro","Error",MessageBoxButtons::OK,MessageBoxIcon ::Exclamation);
}
else{
/*if(this->textBox2->Text!=palabras[2])
{
cont=cont+1;
}*/
StreamWriter^ sw= File::AppendText("usuarios.txt");
sw->WriteLine(cont+":"+this->textBox1->Text+":"+this->textBox2->Text+":"+this->textBox3->Text);
sw->Close();
StreamWriter^ sw2= File::AppendText(this->textBox2->Text+".txt");//REVISAR
sw2->Close();//REVISAR
MessageBox::Show("Has sido registrado","Registro",MessageBoxButtons::OK,Messa geBoxIcon::Information);