Captcha Generator is a simple cross-platform library for generating image captcha.
- Simple & Cross-Platform
- Compatible with Linux and Windows
- Compatible with Docker images based on Linux :)
Installing via NuGet
PM> Install-Package Captcha.Net
dotnet add package Captcha.Net
using Captcha.Net;
namespace ConsoleAppSample
{
class Program
{
static void Main(string[] args)
{
var captchaGenerator = new CaptchaGenerator();
var key = captchaGenerator.GenerateCaptchaCode();
var result = captchaGenerator.GenerateCaptchaImage(200, 100, key);
File.WriteAllBytes($"captcha.jpg", result.CaptchaByteData);
Console.WriteLine(result.CaptchBase64Data);
}
}
}