diff --git a/csharp/ImgBBTest/ImgBBTest.csproj b/csharp/ImgBBTest/ImgBBTest.csproj new file mode 100644 index 0000000..c31c367 --- /dev/null +++ b/csharp/ImgBBTest/ImgBBTest.csproj @@ -0,0 +1,15 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + \ No newline at end of file diff --git a/csharp/ImgBBTest/Program.cs b/csharp/ImgBBTest/Program.cs new file mode 100644 index 0000000..db11f3d --- /dev/null +++ b/csharp/ImgBBTest/Program.cs @@ -0,0 +1,25 @@ +namespace Iminetsoft.Dev.ImgBBTest +{ + public static class Program + { + public static async Task Main(string[] Args) + { + var args = Iminetcore.ConsoleParser.ArgParser.ParseDynamic(Args); + + Console.WriteLine("IMGBB Test Application"); + + var imgbb_token = Environment.GetEnvironmentVariable("IMGBB_TOKEN") ?? args.token ?? args.t; + var imgbb = new ImgBBApi(imgbb_token); + var uploaded = new List(); + + var files = ((string)args.files ?? (string)args.f).Split(",").ToList(); + + if (files.Count()>0) + { + uploaded = await imgbb.UploadImgbbAsync(files); + uploaded.ForEach(f => Console.WriteLine(f)); + } + else Console.WriteLine("No files added for uploading"); + } + } +} \ No newline at end of file