Solved

Copying a file to usb-based storage media from VB.Net 2008

Posted on 2011-02-21
4
1,186 Views
Last Modified: 2012-05-11
My application is a VB.Net application in .net 3.5. I have given a feature for backing up sql database. This creates a .bak file. Now I want to give facility to my user to copy this .bak file on pen/flash drive or USB-based hard-disk. For this:
1. How can I scan the system hardware to find if any USB-based removable storage media is connected?
2. Once that is found, I want to display these drive list from (1) above  in the listbox. Then the user will select the drive.
3. How to check if the selected usb-storage has sufficient space?
4. How to copy my .bak file on this usb-storage?

Regards,
MI
0
Comment
Question by:vj_mi
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
imaki06 earned 500 total points
ID: 34942200
There is an example here.

However it does not see whether that is really an USB-drive. But only if the drivetype is removable..
0
 

Author Comment

by:vj_mi
ID: 34942225
But in that case, even Cd/DVD is considered removable. But copy function will not work in that case.

Regards,
MI
0
 
LVL 3

Expert Comment

by:imaki06
ID: 34942249
There is another function SetupDiGetDeviceRegistryProperty which could be used to get more info on those volumes.

But I do not know how to use it. I just found one example. The example can be found from comments (almost last one).
0
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 34944725
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question