hello,
I'm trying to get a progress bar to show upload status of a file, but I'm not sure how to actually activate the movement of the bar. I found some examples with .NET 2.0, but I'm using 1.1. Here's some of the code I have that deals with the upload:
FileInfo fInfo = new FileInfo(fname);
long numBytes = fInfo.Length;
FileStream fStream = new FileStream(fname, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fStream);
byte [] data = br.ReadBytes((int)numBytes);
string url = http_Ref
WebClient myCli = new WebClient();
myCli.Headers.Add(filename);
myCli.Headers.Add(cook);//cook is my cookie
byte[] retdat;
retdat = myCli.UploadData(url,"POST", data);
I think the obvious part is that since I have the size of the file, if I can get the current status of the upload, I just need to change the progress bar to update that, but I don't know if/how to get the number of bytes sent in the upload.
I'm trying to get a progress bar to show upload status of a file, but I'm not sure how to actually activate the movement of the bar. I found some examples with .NET 2.0, but I'm using 1.1. Here's some of the code I have that deals with the upload:
FileInfo fInfo = new FileInfo(fname);
long numBytes = fInfo.Length;
FileStream fStream = new FileStream(fname, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fStream);
byte [] data = br.ReadBytes((int)numBytes);
string url = http_Ref
WebClient myCli = new WebClient();
myCli.Headers.Add(filename);
myCli.Headers.Add(cook);//cook is my cookie
byte[] retdat;
retdat = myCli.UploadData(url,"POST", data);
I think the obvious part is that since I have the size of the file, if I can get the current status of the upload, I just need to change the progress bar to update that, but I don't know if/how to get the number of bytes sent in the upload.