.Net 获取当前登录的帐号

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace BusinessLayer
{
    class BLError
    {
        public string ErrorAlert()
        {
            string UserName;
            string error;
            error = "Sorry,something wrong!";
            UserName = HttpContext.Current.Request.LogonUserIdentity.Name;
            return UserName + error;
        }
    }
}
原文地址:https://www.cnblogs.com/Aaron-Lee/p/10245079.html