-
Notifications
You must be signed in to change notification settings - Fork 0
/
BTN_FORGET_PASSWORD.cs
54 lines (48 loc) · 1.59 KB
/
BTN_FORGET_PASSWORD.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
42
43
44
45
46
47
48
49
50
51
52
53
54
// Decompiled with JetBrains decompiler
// Type: BTN_FORGET_PASSWORD
// Assembly: Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using UnityEngine;
public class BTN_FORGET_PASSWORD : MonoBehaviour
{
public GameObject email;
private bool invalid;
public GameObject logincomponent;
public GameObject output;
private string DomainMapper(Match match)
{
IdnMapping idnMapping = new IdnMapping();
string ascii = match.Groups[2].Value;
try
{
ascii = idnMapping.GetAscii(ascii);
}
catch (ArgumentException ex)
{
this.invalid = true;
}
return match.Groups[1].Value + ascii;
}
public bool IsValidEmail(string strIn)
{
this.invalid = false;
if (string.IsNullOrEmpty(strIn))
return false;
strIn = Regex.Replace(strIn, "(@)(.+)S", new MatchEvaluator(this.DomainMapper));
return !this.invalid && Regex.IsMatch(strIn, "^(?(\")(\"[^\"]+?\"@)|(([0-9a-z]((\\.(?!\\.))|[-!#\\S%&'\\*\\+/=\\?\\^`\\{\\}\\|~\\w])*)(?<=[0-9a-z])@))(?(\\[)(\\[(\\d{1,3}\\.){3}\\d{1,3}\\])|(([0-9a-z][-\\w]*[0-9a-z]*\\.)+[a-z0-9]{2,17}))S", RegexOptions.IgnoreCase);
}
private void OnClick()
{
if (!this.IsValidEmail(this.email.GetComponent<UIInput>().text))
{
this.output.GetComponent<UILabel>().text = "This e-mail address is not valid.";
}
else
{
this.logincomponent.GetComponent<LoginFengKAI>().resetPassword(this.email.GetComponent<UIInput>().text);
this.output.GetComponent<UILabel>().text = "please wait...";
}
}
}