diff options
| author | Debulois <quentin@debulois.fr> | 2022-10-19 12:43:49 +0200 |
|---|---|---|
| committer | Debulois <quentin@debulois.fr> | 2022-10-19 12:43:49 +0200 |
| commit | d482ed88724b9dc84ee5f2b70252d4aab6b837d9 (patch) | |
| tree | 957f35752d0669835cf299884cc72eac09fbcf80 /WinKeyRecover/keyManager/CheckIsValid.cs | |
| parent | d0ed44e15795a4090d95d137532ecd59ae0aaaa5 (diff) | |
Initial commitVPS
Diffstat (limited to 'WinKeyRecover/keyManager/CheckIsValid.cs')
| -rw-r--r-- | WinKeyRecover/keyManager/CheckIsValid.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/WinKeyRecover/keyManager/CheckIsValid.cs b/WinKeyRecover/keyManager/CheckIsValid.cs new file mode 100644 index 0000000..5b6775b --- /dev/null +++ b/WinKeyRecover/keyManager/CheckIsValid.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WinKeyRecover +{ + internal class CheckIsValid + { + private string key; + + public bool CheckKey(char[] validChars, string key) + { + this.key = key.ToUpper(); + + if (this.key != string.Empty + && this.key.Length == 29 + && this.key.Contains('*') + ) + { + for (int i = 0; i < key.Length; i++) + { + if (this.key[i] != '-' + && this.key[i] != '*' + && !validChars.Contains(this.key[i]) + ) + { + return false; + } + } + } + else + { + return false; + } + + return true; + } + } +} |
