开发者

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 开发者_如何学Con( whether it is admin or assitant user or merchant)

Thank you


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


        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();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜