zhemdml wjdtkdghk

This commit is contained in:
2024-11-06 21:09:57 +09:00
parent bb5f6d6cd6
commit 008365566e

View File

@@ -16,27 +16,35 @@ class Program
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
//Console.WriteLine("Hello, World!"); //Console.WriteLine("Hello, World!");
//Uri uri = new Uri("https://a4plane.duckdns.org/minio/");
Uri url = new Uri("http://a4plane.duckdns.org/a4plane/djdp");
//Uri url = new Uri("https://github.com/netdata/netdata");
using (var httpClient = new HttpClient())
{
var content = await httpClient.GetStringAsync(url);
Console.Write(content);
};
// Minio 설정 (Minio 클라이언트 인스턴스 생성) // Minio 설정 (Minio 클라이언트 인스턴스 생성)
IWebProxy proxy = new WebProxy("https://a4plane.duckdns.org", 443); //IWebProxy proxy = new WebProxy("https://a4plane.duckdns.org/minio/", 443);
IMinioClient minioClient = new MinioClient() //IMinioClient minioClient = new MinioClient()
.WithEndpoint("a4plane.duckdns.org") // .WithEndpoint(uri)
.WithCredentials("a4plane", "661434Ghkd") // .WithCredentials("a4plane", "661434Ghkd")
.WithSSL() // .WithSSL()
.WithProxy(proxy) // .WithProxy(proxy)
.Build(); // .Build();
// 압축 및 업로드할 폴더 및 파일 경로 설정 //// 압축 및 업로드할 폴더 및 파일 경로 설정
string sourceFolder = "testo"; //string sourceFolder = "testo";
string bucketName = "testob"; //string bucketName = "testob";
string objectName = "testtt.lz4"; //string objectName = "testtt.lz4";
string outputLz4File = Path.Combine(Directory.GetCurrentDirectory(), objectName); //string outputLz4File = Path.Combine(Directory.GetCurrentDirectory(), objectName);
// 폴더를 압축 //// 폴더를 압축
CompressFolderWithProgress(sourceFolder, outputLz4File); //CompressFolderWithProgress(sourceFolder, outputLz4File);
// 압축한 파일을 Minio로 업로드 //// 압축한 파일을 Minio로 업로드
await UploadWithProgress((MinioClient)minioClient, bucketName, objectName, outputLz4File); //await UploadWithProgress((MinioClient)minioClient, bucketName, objectName, outputLz4File);
} }
static void CompressFolderWithProgress(string sourceFolder, string outputLz4File) static void CompressFolderWithProgress(string sourceFolder, string outputLz4File)
@@ -130,6 +138,7 @@ class Program
.WithBucket(bucketName) .WithBucket(bucketName)
.WithObject(objectName) .WithObject(objectName)
.WithFileName(filePath) .WithFileName(filePath)
.WithContentType("application/octet-stream") .WithContentType("application/octet-stream")
.WithServerSideEncryption(ssec) .WithServerSideEncryption(ssec)
.WithProgress(progress); .WithProgress(progress);