tags:

views:

23

answers:

2

Hi Everybody, 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

A: 
        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();
        }
Adi_aks
Thank you very much for your reply
Mohan Sharma
+2  A: 

You want to look at ASP.NET Membership and Roles.

Jakob Gade