Skip to content

.Net cross-platform captcha generator with SixLabors library on .NET Core

License

Notifications You must be signed in to change notification settings

bezzad/CaptchaGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Windows x64 .NET Ubuntu x64 NuGet NuGet License Generic badge

Captcha Generator .Net

Captcha Generator is a simple cross-platform library for generating image captcha.

Features

  • Simple & Cross-Platform
  • Compatible with Linux and Windows
  • Compatible with Docker images based on Linux :)

Installing via NuGet

PM> Install-Package Captcha.Net

Installing via the .NET Core command line interface

dotnet add package Captcha.Net

Usage:

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);
		}
	}
}