ADCaptcha 1.0.4
dotnet add package ADCaptcha --version 1.0.4
NuGet\Install-Package ADCaptcha -Version 1.0.4
<PackageReference Include="ADCaptcha" Version="1.0.4" />
paket add ADCaptcha --version 1.0.4
#r "nuget: ADCaptcha, 1.0.4"
// Install ADCaptcha as a Cake Addin #addin nuget:?package=ADCaptcha&version=1.0.4 // Install ADCaptcha as a Cake Tool #tool nuget:?package=ADCaptcha&version=1.0.4
README.md
ADCaptcha
ADCaptcha is a secure CAPTCHA generator library for ASP.NET web applications.
Description
ADCaptcha provides a simple and effective way to integrate CAPTCHA functionality in your ASP.NET projects. It generates CAPTCHA images with customizable distortion techniques to prevent automated bots and spam, ensuring that only humans can access sensitive areas of your website.
Features
- Random CAPTCHA text generation
- Customizable CAPTCHA image dimensions and distortion techniques
- CAPTCHA verification for user input (Comparison should be case-sensitive or case-insensitive. Default case-insensitive)
- Difficulty levels: Easy, Medium, and Hard
- NoiseMode: Easy, Medium, and Hard
- DistortionTechnique: Warp, NoiseLines, Swirl and Stitch
Installation
You can install ADCaptcha via NuGet Package Manager. Use the following command in the Package Manager Console:
Install-Package ADCaptcha
Usage
Add the ADCaptcha library to your ASP.NET project.
Generate a new CAPTCHA text and image with the desired difficulty level:
using ADCaptcha;
// ...
ICaptchaGenerator captchaGenerator = CaptchaFactory.CreateCaptchaGenerator();
// Generate a new CAPTCHA text and image with the selected difficulty level/mode
//string captchaText = captchaGenerator.GenerateRandomText();
string captchaText = captchaGenerator.GenerateRandomText(6, DifficultyMode.Medium);
// You can use anyone as required. Generate the CAPTCHA image and convert it to a base64 string.
//byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 150, 50);
byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 150, 50, 24, System.Drawing.Color.White, System.Drawing.Color.DarkBlue, DistortionTechnique.NoiseLines, DistortionTechnique.Swirl);
//byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40, null, 22, null, null,true, DistortionTechnique.Warp);
// You can use anyone as required. Generate the CAPTCHA image and convert it to a base64 string.
//byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40);
//byte[] captchaImageBytes = captchaGenerator.GenerateGraphCaptcha(captchaText, 140, 40);
//byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40,NoiseMode.Hard);
Choose from the following difficulty levels:
DifficultyMode.Easy: Generates a numeric CAPTCHA text.
DifficultyMode.Medium: The default difficulty level with a lowercase alphanumeric CAPTCHA text.
DifficultyMode.Hard: Generates a mixed upper and lower with numeric CAPTCHA text.
1. Display the CAPTCHA image to the user along with an input field for the user to enter the CAPTCHA text.
2. On form submission, verify the user's input:
string userCaptcha = CaptchaTextBox.Text.Trim();
bool isValidCaptcha = captchaGenerator.VerifyCaptcha(userCaptcha, captchaText, caseSensitive: true);
if (isValidCaptcha)
{
// CAPTCHA is valid. Proceed with the form submission.
}
else
{
// CAPTCHA is invalid. Show an error message to the user.
}
License
This library is distributed under the MIT License.
Contact
For any questions or feedback, feel free to reach out to the project maintainer.
Name: ASHOK DUDI
Email: adudi82@gmail.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.