2010-09-25 34 views
0

我正在建设的网站有三种类型的用户。管理员,商家和助理用户。 哪里来存储信息,使我的应用程序就会知道哪些用户已登录(无论是管理员或assitant用户或商家)存储记录器信息asp.net

谢谢

回答

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

非常感谢您的回复 – 2010-09-25 06:31:28