public class Auth { public static string Lang { get { if (HttpContext.Current.Request.Cookies[Encryption.Encrypt("Lang")] == null || HttpContext.Current.Request.Cookies[Encryption.Encrypt("Lang")].Value == null) return null; return Encryption.Decrypt( HttpContext.Current.Request.Cookies[Encryption.Encrypt("Lang")].Value); } set { HttpCookie s = new HttpCookie(Encryption.Encrypt("Lang"), Encryption.Encrypt( value)); s.Expires = DateTime.Now.AddYears(1); HttpContext.Current.Response.Cookies.Add(s); } } public static bool IsArabic { get { return Lang == "Arabic" && Lang != null; } } public static bool IsEnglish { get { return Lang != "Arabic" && Lang != null; } } }
Auth.Lang = "English";
if(Auth.IsEnglish)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)