|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Profile;
using System.Web.Security;
namespace TwoFactorWeb
{
public class TwoFactorProfile : ProfileBase
{
public static TwoFactorProfile CurrentUser
{
get
{
return GetByUserName(Membership.GetUser().UserName);
}
}
public static TwoFactorProfile GetByUserName(string username)
{
return (TwoFactorProfile)Create(username);
}
public DateTime? LastLoginAttemptUtc
{
get
{
try
{
return (DateTime?)base["LastLoginAttemptUtc"];
}
catch
{
return null;
}
}
set
{
base["LastLoginAttemptUtc"] = value;
Save();
}
}
public string TwoFactorSecret
{
get
{
return (string)base["TwoFactorSecret"];
}
set
{
base["TwoFactorSecret"] = value;
Save();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been a software developer since 2005, focusing on .Net applications with MS SQL backends, and recently, C++ applications in Linux, Mac OS X, and Windows.