Reputation: 165
i am building site where there are three types of user. Admin,Merchant and Assitant User. Where to store information so that my application will know which user has logged on( whether it is admin or assitant user or merchant)
Thank you
Upvotes: 0
Views: 67
Reputation: 511
string path = DateTime.Today.ToString("dd-mm-yy") + ".txt";
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
}
using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))
{
w.WriteLine("\r\nLog Entry : ");
w.WriteLine("Membership.GetUser().UserName);
w.Flush();
w.Close();
}
Upvotes: 0