Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/02/2008, 14:49
jorgerulez
 
Fecha de Ingreso: septiembre-2006
Ubicación: Culiacán Sinaloa México
Mensajes: 5
Antigüedad: 18 años, 5 meses
Puntos: 1
Pregunta backgroundWorker1 C#

Hola, tengo un metodo que lo pueden ver abajo.. este cuando se llama tarda un buen tiempo en hacer toda su tarea entonces deseo implementarle un progresbar para que valla cargando de la mano al trabajo que esta realizando. estube tratando con backgroundWorker1 pero la verdad no pude hecharlo andar.

saludos!

private void Cortar()
{
int i = 0;
CortarArchivo Objeto = new CortarArchivo();
Objeto.PatchArchivo = this.txtPatchCortar.Text;
Objeto.NumeroPartes = byte.Parse(this.txtNumPartes.Text);
FileInfo fileInfo = new FileInfo(this.txtPatchCortar.Text);
string Aux = fileInfo.Length.ToString();
Objeto.TotalBytes = int.Parse(Aux) ;

string[] buffer = Objeto.Corte();

while (i < Objeto.NumeroPartes)
{
using (StreamWriter sw = new StreamWriter(this.txtPatchGuardarC.Text + txtNombreCortar.Text + i+".jr",true, Encoding.Default))
{
sw.Write(buffer[i]);
i++;
}
}
}