How can I read files from a camera connected via usb

In C # how to copy a file from a camera to a local drive? The camera is connected via USB, and it does not appear as a standard drive.

I am using Sony Handycam HDR-CX160. I want to write a small C # windowsform application that copies video files from a device.

So, how do my applications copy files from a device connected via usb? It does not appear as a disk, but appears in Windows Explorer. When I look for drives in C #, aren't they listed?

Thanks!

======== UPDATE ========

I'm going to try to ask this question differently and hopefully it opens again.

Using C # I need to copy a file from the camera to a local hard drive. If I'm new, this line of code will do this.

string cameraPath = ????? string sourcePath = Path.Combine(cameraPath, @"\Video\2012-1-1.WMV"); string targetPath = @"C:\Video\2012-1-1.WMV"; System.IO.File.Copy(sourceFile, destFile, true); 

So how can I enable CameraPath? Is there any other way to do this all together?

+7
source share
1 answer

I do not know the features of your device, and it is best to use the software that came with your device.

However, if the digital camera is not a disk that you can read, the files may support Windows Image Acquisition . The easiest way to use this from C # is to use the Windows Automated Image Capture Level . Scott Hanselman has an old Coding4Fun article Look at me! Windows Image Acquisition on Channel 9.

If you can remove the flash card from the camera, you can also try to read this card using a card reader to get direct access to the files.

In addition, if you want to run the application when the camera is connected, you need to register an AutoPlay event handler . There is an event when the camera is connected.

+4
source

All Articles