-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64d09c8
commit 68a28b7
Showing
57 changed files
with
2,543 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
## Ignore Visual Studio temporary files, build results, and | ||
## files generated by popular Visual Studio add-ons. | ||
*.ttf | ||
*.ttc | ||
*.jpg | ||
*.png | ||
graduation-photos-management/wwwroot/lib/* | ||
|
||
# User-specific files | ||
*.suo | ||
*.user | ||
*.sln.docstates | ||
|
||
# Build results | ||
|
||
[Dd]ebug/ | ||
[Rr]elease/ | ||
x64/ | ||
[Bb]in/ | ||
[Oo]bj/ | ||
|
||
# MSTest test Results | ||
[Tt]est[Rr]esult*/ | ||
[Bb]uild[Ll]og.* | ||
|
||
*_i.c | ||
*_p.c | ||
*_i.h | ||
*.ilk | ||
*.meta | ||
*.obj | ||
*.pch | ||
*.pdb | ||
*.pgc | ||
*.pgd | ||
*.rsp | ||
*.sbr | ||
*.tlb | ||
*.tli | ||
*.tlh | ||
*.tmp | ||
*.tmp_proj | ||
*.log | ||
*.vspscc | ||
*.vssscc | ||
.builds | ||
*.pidb | ||
*.log | ||
*.svclog | ||
*.scc | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opensdf | ||
*.sdf | ||
*.cachefile | ||
|
||
# Visual Studio profiler | ||
*.psess | ||
*.vsp | ||
*.vspx | ||
|
||
# Guidance Automation Toolkit | ||
*.gpState | ||
|
||
# ReSharper is a .NET coding add-in | ||
_ReSharper*/ | ||
*.[Rr]e[Ss]harper | ||
*.DotSettings.user | ||
|
||
# Click-Once directory | ||
publish/ | ||
|
||
# Publish Web Output | ||
*.Publish.xml | ||
*.pubxml | ||
*.azurePubxml | ||
|
||
# NuGet Packages Directory | ||
## TODO: If you have NuGet Package Restore enabled, uncomment the next line | ||
packages/ | ||
## TODO: If the tool you use requires repositories.config, also uncomment the next line | ||
!packages/repositories.config | ||
|
||
# Windows Azure Build Output | ||
csx/ | ||
*.build.csdef | ||
|
||
# Windows Store app package directory | ||
AppPackages/ | ||
|
||
# Others | ||
sql/ | ||
*.Cache | ||
ClientBin/ | ||
[Ss]tyle[Cc]op.* | ||
![Ss]tyle[Cc]op.targets | ||
~$* | ||
*~ | ||
*.dbmdl | ||
*.[Pp]ublish.xml | ||
|
||
*.publishsettings | ||
|
||
# RIA/Silverlight projects | ||
Generated_Code/ | ||
|
||
# Backup & report files from converting an old project file to a newer | ||
# Visual Studio version. Backup files are not needed, because we have git ;-) | ||
_UpgradeReport_Files/ | ||
Backup*/ | ||
UpgradeLog*.XML | ||
UpgradeLog*.htm | ||
|
||
# SQL Server files | ||
App_Data/*.mdf | ||
App_Data/*.ldf | ||
|
||
# ========================= | ||
# Windows detritus | ||
# ========================= | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Mac desktop service store files | ||
.DS_Store | ||
|
||
_NCrunch* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.2.32602.215 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "graduation-photos-management", "graduation-photos-management\graduation-photos-management.csproj", "{210252CE-EB70-4FAE-B894-EFAD36A91B53}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{210252CE-EB70-4FAE-B894-EFAD36A91B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{210252CE-EB70-4FAE-B894-EFAD36A91B53}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{210252CE-EB70-4FAE-B894-EFAD36A91B53}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{210252CE-EB70-4FAE-B894-EFAD36A91B53}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4F8EE7A8-DDB7-41D3-90EB-6E9B4B22B38E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 gebiWangshushu | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
|
||
|
||
|
||
|
||
# Hei.Captcha | ||
|
||
[![Hei.Captcha](https://img.shields.io/badge/nuget-v0.2.0-blue)](https://www.nuget.org/packages/Hei.Captcha/) | ||
|
||
.net core,跨平台的验证码生成工具包,支持动态gif验证码。基于[ImageSharp](https://github.com/SixLabors/ImageSharp)。 | ||
|
||
|
||
|
||
> 使用.NET Standard 2.0,目前仅测试过.net core的支持,.net frameword 4.6.1 及以上请自行测试~ | ||
|
||
|
||
## 中文泡泡验证码 | ||
|
||
|
||
|
||
![img](images/BubbleCode.png) | ||
|
||
![1564563919705](images/1564563919705.png) | ||
|
||
![1564563740706](images/1564563740706.png) | ||
|
||
|
||
|
||
|
||
|
||
## 字母数字组合验证码 | ||
|
||
![img](images/HybridCode.png) | ||
|
||
![1564563801717](images/1564563801717.png) | ||
|
||
![1564563816361](images/1564563816361.png) | ||
|
||
![1564563853298](images/1564563853298.png) | ||
|
||
![1564563877047](images/1564563877047.png) | ||
|
||
## 动态gif中文泡泡验证码 | ||
|
||
![](images/bubble1.gif) | ||
|
||
![](images/bubble2.gif) | ||
|
||
![](images/bubble3.gif) | ||
|
||
## 动态gif字母数字组合验证码 | ||
|
||
![](images/engif1.gif) | ||
|
||
![](images/engif2.gif) | ||
|
||
![](images/engif3.gif) | ||
|
||
## 表单示例 | ||
|
||
![1565146764062](images/form.gif) | ||
|
||
|
||
|
||
## 使用 | ||
|
||
**(0.2.0及以下版本)**开始之前需先把字体文件<https://github.com/gebiWangshushu/Hei.Captcha/tree/master/Demo/fonts>整个fonts目录下载放到程序根目录(如果只想下载一个文件夹可以使用chrome插件:[GitZip for github](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)) | ||
|
||
|
||
|
||
|
||
|
||
``` | ||
Install-Package Hei.Captcha | ||
``` | ||
|
||
|
||
|
||
``` | ||
//StartUp.cs,Method ConfigureServices() | ||
services.AddHeiCaptcha(); | ||
``` | ||
|
||
|
||
|
||
``` | ||
private readonly SecurityCodeHelper _securityCode; | ||
public HomeController(SecurityCodeHelper securityCode) | ||
{ | ||
this._securityCode = securityCode; | ||
} | ||
/// <summary> | ||
/// 泡泡中文验证码 | ||
/// </summary> | ||
/// <returns></returns> | ||
public IActionResult BubbleCode() | ||
{ | ||
var code = _securityCode.GetRandomCnText(2); | ||
var imgbyte = _securityCode.GetBubbleCodeByte(code); | ||
return File(imgbyte, "image/png"); | ||
} | ||
/// <summary> | ||
/// 数字字母组合验证码 | ||
/// </summary> | ||
/// <returns></returns> | ||
public IActionResult HybridCode() | ||
{ | ||
var code = _securityCode.GetRandomEnDigitalText(4); | ||
var imgbyte = _securityCode.GetEnDigitalCodeByte(code); | ||
return File(imgbyte, "image/png"); | ||
} | ||
/// <summary> | ||
/// gif泡泡中文验证码 | ||
/// </summary> | ||
/// <returns></returns> | ||
public IActionResult GifBubbleCode() | ||
{ | ||
var code = _securityCode.GetRandomCnText(2); | ||
var imgbyte = _securityCode.GetGifBubbleCodeByte(code); | ||
return File(imgbyte, "image/gif"); | ||
} | ||
/// <summary> | ||
/// gif数字字母组合验证码 | ||
/// </summary> | ||
/// <returns></returns> | ||
public IActionResult GifHybridCode() | ||
{ | ||
var code = _securityCode.GetRandomEnDigitalText(4); | ||
var imgbyte = _securityCode.GetGifEnDigitalCodeByte(code); | ||
return File(imgbyte, "image/gif"); | ||
} | ||
``` | ||
|
||
### 高级 | ||
|
||
参照Demo, 通过修改/丰富应用程序运行目录`./fonts`目录下的字体文件,生成更多不同字体组合的验证码。 | ||
|
||
**(仅在0.2.0及以下版本有效)** | ||
|
||
|
||
|
||
## License | ||
|
||
*Hei.Captcha* is licensed under the [MIT license](<https://github.com/gebiWangshushu/Hei.Captcha/blob/master/LICENSE>). | ||
|
||
## 公众号 | ||
|
||
欢迎关注我的公众号。虽然有点懒,不过偶尔打打鸡血还是会写点东西的,你的关注就是我的动力,谢谢支持~~ | ||
|
||
![1565148379847](images/1565148379847.png) | ||
|
Oops, something went wrong.