From b30ff5ad1445aa9e3bd4c0a78ccbd418e984aeda Mon Sep 17 00:00:00 2001 From: lukejelse04 Date: Sun, 3 Oct 2021 22:35:59 +0100 Subject: [PATCH] Added Form Authenticator Includes the methods needed to verify the user inputs and to validate that they are correct. --- .../FormAuthenticator/FormAuthenticator.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Controllers/FormAuthenticator/FormAuthenticator.cs diff --git a/Controllers/FormAuthenticator/FormAuthenticator.cs b/Controllers/FormAuthenticator/FormAuthenticator.cs new file mode 100644 index 0000000..b7bef3c --- /dev/null +++ b/Controllers/FormAuthenticator/FormAuthenticator.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace EFB.Controllers.FormAuthenticator +{ + public static class FormAuthenticator + { + + public static bool ValidateEMail(string EMail){ + if (EMail.Contains("@") && EMail.Contains(".") && !EMail.Contains(" ")) + { + if (EMail.Count(x => x == '@') == 1) + { + return true; + } + } + return false; + } + + + } +} \ No newline at end of file