public static void readFile() { TransferUtility fileTransferUtility = new TransferUtility(new AmazonS3Client(accessKey, secretKey, Amazon.RegionEndpoint.USEast1)); BasicAWSCredentials basicCredentials = new BasicAWSCredentials(accessKey, secretKey); AmazonS3Client s3Client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey), Amazon.RegionEndpoint.USEast1); ListObjectsRequest request = new ListObjectsRequest(); ListObjectsResponse response = s3Client.ListObjects(request.BucketName = bucketName, request.Prefix = csvFileName); foreach (S3Object obj in response.S3Objects) { try { //string filename = directoryPath + "\\" + obj.Key; //FileStream fs = File.Create(filename); //fs.Close(); //Console.WriteLine("{0}", obj.Key); fileTransferUtility.Download(csvFileName, bucketName, obj.Key); } catch (Exception ex) { Console.WriteLine(ex.Message, ex.InnerException); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)