Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
I have .cab file to scan barcodes and save in application folder in portable barcode scanner motorola mc2180 model. barcodes are saving as .csv file in that folder. i m happy with it but using .net program how can i export or transfer file from that folder to local computer c:/ drive???
Please any one help this. i will very glad to you.

- Ramya
ramya544@gmail.com
Posted
Updated 10-May-14 0:51am
v2

1 solution

you can use this code to transfer files from one folder to another.

Create one window application and you can do this.

C#
using System.IO;

string sourcePath = @"D:\test";
string targetPath = @"D:\test_new";
if (!Directory.Exists(targetPath))
{
   Directory.CreateDirectory(targetPath);
}
foreach (var srcPath in Directory.GetFiles(sourcePath))
{
    //Copy the file from sourcepath and place into mentioned target path,
    //Overwrite the file if same file is exist in target path
    File.Copy(srcPath, srcPath.Replace(sourcePath, targetPath), true);
}
 
Share this answer
 
Comments
Vinod Thonangi 10-May-14 12:49pm    
Scanner Drive path is not found as drive... it is saying path not found. because that is portable device... it wont retrieve as drive list path. eg., c:/ , d:/, e:/, are the list of drives but though scanner is one of the list in drives its path is temporary listed but not like drive for egs if my scanner name is HSS_SCANNER it shows in mycomputer withthat name but we cant access that path as url in browser. Pls try and help me@@@

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