Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在asp.net中存储记录器信息_Asp.net - Fatal编程技术网

在asp.net中存储记录器信息

在asp.net中存储记录器信息,asp.net,Asp.net,我正在建设的网站有三种类型的用户。管理员、商户和助理用户。 在何处存储信息,以便我的应用程序知道哪个用户已登录(无论是管理员、助理用户还是商户) 谢谢你你想看看ASP.NET和。非常感谢你的回复 string path = DateTime.Today.ToString("dd-mm-yy") + ".txt"; if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))

我正在建设的网站有三种类型的用户。管理员、商户和助理用户。 在何处存储信息,以便我的应用程序知道哪个用户已登录(无论是管理员、助理用户还是商户)


谢谢你

你想看看ASP.NET和。

非常感谢你的回复
        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();
        }