-
Notifications
You must be signed in to change notification settings - Fork 35
/
Global.asax.cs
41 lines (39 loc) · 1.22 KB
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Lazy.Captcha.Core;
using Lazy.Captcha.Core.Generator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Sample.MvcFramework
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
CaptchaConfig();
}
private void CaptchaConfig()
{
var captchaService = CaptchaServiceBuilder
.New()
.Width(98)
.Height(35)
.FontSize(20)
.CaptchaType(CaptchaType.ARITHMETIC)
.FontFamily(DefaultFontFamilys.Instance.Ransom)
.InterferenceLineCount(3)
.Animation(false)
.Build();
CaptchaHelper.Initialization(captchaService);
}
}
}