public async Task Delete_File(string bucketName, string objectName) { try { Minio_connten_class minio_connten = new Minio_connten_class(); MinioClient minio_client = minio_connten.Minio_connten(); await minio_client.RemoveObjectAsync(bucketName, objectName); } catch (Exception Delete_Erroe) { Console.WriteLine("Delete Erroe: {0}", Delete_Erroe.Message); } }
public void Download_File(string bucketName, string objectName, string filePath) { try { Stopwatch watch = new Stopwatch(); watch.Start(); Minio_connten_class minio_connten = new Minio_connten_class(); MinioClient minio_client = minio_connten.Minio_connten(); Run(minio_client, bucketName, objectName, filePath).Wait(); watch.Stop(); long Time_ConSuming = watch.ElapsedMilliseconds; Console.WriteLine("文件包: {0}, 耗时: {1} ms \r\n", filePath, Time_ConSuming); } catch (Exception Error) { Console.WriteLine("Download Error: {0}", Error.Message); } }
public void Show_All_Bucket() { try { Minio_connten_class minio_connten = new Minio_connten_class(); MinioClient minio_client = minio_connten.Minio_connten(); var getListBucketsTask = minio_client.ListBucketsAsync(); foreach (Bucket bucket in getListBucketsTask.Result.Buckets) { Console.WriteLine("BuckerName: {0}, Create Time: {1} \r\n", bucket.Name, bucket.CreationDateDateTime); } } catch (Exception Error) { Console.WriteLine(Error.Message); } }