Click here to Skip to main content
15,888,048 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to transfer a .bin file to my device through usb.Acccording to this file the device will disconnect automatically from application once file transfer is completed.The file size is around 2MB.I am able to tranfer file.My problem is I should use some progress indicator like progress bar.How can I use in this case.

What I have tried:

As of now I will open the file and store full data to a buffer and send this buffer though USB.
Posted
Updated 12-Jun-18 22:30pm
Comments
[no name] 13-Jun-18 3:07am    
How do you send the buffer through USB? If you send it in parts, you could update your progress bar every time a part is sent.
If you could share your code it would be easier to make suggestions.
Member 13688117 13-Jun-18 5:56am    
byte[] readBuffer = new byte[2000000];
Filestream dFile = new FileStream(fileName,FileMode.Open,FileAccess.Read);
int read=dFile.Read(readBuffer,0,readBuffer.Length);
USBInterface iface;//selects device interface
iface.OutPipe.Write(readbuffer,0,read);

I send it as a bulk not splitted.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900