im Trying to display percentage while uploading file to ftp dosnt work what is missing? this is the code im using
{
PrgBar.Invoke(
(MethodInvoker)delegate
{
PrgBar.Maximum = (int)fileStream.Length;
});
byte[] buffer = new byte[10240];
int read;
while ((read = fileStream.Read(buffer, 0, buffer.Length)) > 0)
{
ftpStream.Write(buffer, 0, read);
PrgBar.Invoke((MethodInvoker)delegate
{
PrgBar.Value = (int)fileStream.Position;
int percent = (PrgBar.Value / PrgBar.Maximum) * 100;
**LblPercent.Text = percent.ToString()** + "%";
});
}
}
tnx for any help :)