Mohan Sharma
Mohan Sharma

Reputation: 165

storing logger information asp.net

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

Answers (2)

Jakob Gade
Jakob Gade

Reputation: 12419

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

Upvotes: 2

Adi_aks
Adi_aks

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

Related Questions