Hei.Captcha.V2 1.1.0

dotnet add package Hei.Captcha.V2 --version 1.1.0                
NuGet\Install-Package Hei.Captcha.V2 -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hei.Captcha.V2" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hei.Captcha.V2 --version 1.1.0                
#r "nuget: Hei.Captcha.V2, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hei.Captcha.V2 as a Cake Addin
#addin nuget:?package=Hei.Captcha.V2&version=1.1.0

// Install Hei.Captcha.V2 as a Cake Tool
#tool nuget:?package=Hei.Captcha.V2&version=1.1.0                

更新说明

  1. 基本保证和之前版本使用一致
  2. 在上一个版本的基础之上增加了配置功能(若不进行配置,则使用默认配置)

使用方法

  1. 基础使用和之前版本一致,只是增加了配置功能,相关配置项如下: 代码示例:
builder.Services.AddHeiCaptcha();
builder.Services.Configure<HeiCaptchaOptions>(op =>
{
	op.CircleCount = 10;
        op.GifFrameCount = 5;
        op.EnCodeLength = 6;
	op.CnCodeLength = 6;
	op.ImageWidth = 300;
	op.ImageHeight = 100;
	op.Delay = 300;
	op.CircleMinimalRadius = 10;
	op.CircleMaximumRadius = 30;
	op.UseCircleDecoration = true;
	op.UseGridDecoration = true;
});
项目 含义
CircleCount 生成验证码图片当中圆圈数量
GifFrameCount 动图验证码生成的帧数,注意这个包中gif动图是循环的,所以没有必要将这个数值指定的特别大,否则容易影响生成速度
EnCodeLength 英文验证码字符长度
CnCodeLength 中文验证码字符长度
ImageWidth 生成验证码图片的宽度
ImageHeight 生成验证码图片的高度
Delay 动态验证码每一帧之间的间隔(单位是厘秒,百分之一秒,可以参考ImageSharp对于生成gif的配置)
CircleMinimalRadius 圆圈最小半径
CircleMaximumRadius 圆圈最大半径
UseCircleDecoration 是否启用圆圈
UseGridDecoration 是否启用随机线段
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 26 2/19/2025
1.0.0 104 12/24/2024