Added ImgBB Test app

This commit is contained in:
iminet
2026-09-27 12:28:41 +02:00
parent d4a5a7ade2
commit e2d97d5710
2 changed files with 40 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Iminetcore" Version="26.8.2419.568" />
<PackageReference Include="Iminetsoft.ImgBBApi" Version="1.0.6" />
</ItemGroup>
</Project>
+25
View File
@@ -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<string>();
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");
}
}
}