0

我刚刚创建了一个 Web 应用程序并通过 IIS(6.1) 上传它,因为我将它上传到 IIS,所以我遇到了一个问题。在应用程序中,用户的身份验证是通过 AD(Active Directory)组完成的。当用户“A”登录到应用程序时,它工作正常,主页显示欢迎消息,如“欢迎用户:A”,但是当用户“B”登录到应用程序时会出现问题。当用户“B”登录,用户“A”刷新其页面时,用户“A”的主页显示欢迎消息,如“欢迎用户:B”。请注意,两个用户都在不同的物理机器上。

谁能帮我解决这个问题?

这是我的代码:当登录页面加载时,执行以下代码:

protected void Page_Load(object sender, EventArgs e)
    {            
        _txtPassword.Focus();
        lb_errormsg.Visible = false;
        try
        {

            if (!Page.IsPostBack)
            {
                LogHelper.Logger.Info("Load Login Page.");
                LogHelper.Logger.Info("Get Employee ID and Domain into Variables.");
                _txtUserid.Text = User.Identity.Name;
                string[] str = _txtUserid.Text.Replace(@"\", "-").Split('-');
                configureUser.EmpID = str[1];
                configureUser.EmpDomain = str[0];

         LogHelper.Logger.Info("Set Employee ID and Domain into variables complete.");

                LogHelper.Logger.Info("Try to Get ConnectionString.");
                //Set Connection String...
                con_string.Connectionstring = con_string.GetConnectionString();
                LogHelper.Logger.Info("Get ConnectionString complete.");
            }

        }
        catch (Exception ex)
        {

        }
    }

在页面加载时,它会自动在文本框中填写员工 ID,并要求用户输入密码。我在“configureUser.EmpID”变量中设置了员工 ID。

public void _FillStartUpInformation()
{
    LogHelper.Logger.Info("Attempt to fill list of BU's");
        // Fill Workstream DataTable...
        configureUser.BUDT = businessUser.CPOGetBUs(con_string.Connectionstring);
        LogHelper.Logger.Info("Fill list of BU's successfully.");

    LogHelper.Logger.Info("Attempt to fill Employee Datatable.");
        // Fill Employee DataTable..
        configureUser.EmployeeDT 
       = businessUser.CPOGetAllEmployees(con_string.Connectionstring);
        LogHelper.Logger.Info("Fill Employee Datatable successfully.");

        LogHelper.Logger.Info("Attempt to fill employee details into variables.");
        // Fill Employee Details Into Variables...
        DataRow[] dr 
        = configureUser.EmployeeDT.Select("EmpID = '" + configureUser.EmpID + "'");

        configureUser.BU 
        = configureUser.BUDT.Select
        ("BUID = '" + dr[0]["BU"].ToString() + "'")[0]["BU"].ToString();

        configureUser.EmpName = dr[0]["EmpName"].ToString();
        configureUser.Email = dr[0]["EmailID"].ToString();
        if (dr[0]["OBU"].ToString().Contains(','))
        {
         configureUser.EmpOBU = new string[dr[0]["OBU"].ToString().Split(',').Count()];
            configureUser.EmpOBU = dr[0]["OBU"].ToString().Split(',');
        }
        else
        {
            configureUser.EmpOBU = new string[1];
            configureUser.EmpOBU[0] = dr[0]["OBU"].ToString();
        }
        configureUser.ManagerName = dr[0]["ManagersName"].ToString();

        configureUser.ManagerEmail 
        = configureUser.EmployeeDT.Select
        ("EmpName = '" + configureUser.ManagerName + "'")[0]["EmailID"].ToString();

        configureUser.BUID = dr[0]["BU"].ToString();
        configureUser.IsReviewer = Convert.ToBoolean(dr[0]["Reviewer"]);

        LogHelper.Logger.Info("Fill employee details into variables completed.");

        LogHelper.Logger.Info("Attempt to fill OBU Datatable.");
        // Fill Subteam DataTable...
        configureUser.OBUDT 
        = businessUser.CPOGetOBUs(con_string.Connectionstring, configureUser.BUID);
        LogHelper.Logger.Info("Fill OBU Datatable completed.");


        LogHelper.Logger.Info("Attempt to fill Product Datatable.");
        // Fill Product DataTable...
        configureUser.ProductDT 
        = businessUser.CPOGetProducts(con_string.Connectionstring, configureUser.BUID);
        LogHelper.Logger.Info("Fill Product Datatable completed.");

        LogHelper.Logger.Info("Attempt to fill Checkpoints definition Datatable.");
        //Fill Checkpoints Definitions....
        configureUser.CheckpointsDefinition 
        = businessUser.CPOGet_QCCheckPoints_Definition(con_string.Connectionstring);
        LogHelper.Logger.Info("Fill Checkpoints definition Datatable completed.");

        LogHelper.Logger.Info("Attempt to fill Process Datatable.");
        // Fill Process DataTable...
        configureUser.ProcessDT 
       = businessUser.CPOGetProcesses(con_string.Connectionstring, configureUser.BUID);
        LogHelper.Logger.Info("Fill Process Datatable completed.");

        LogHelper.Logger.Info("Attempt to fill Process Hierarchy Datatable.");
        // Fill Process Hierarchy Details...
        configureUser.ProcessHierarchyDT 
        = businessUser.CPOGetProcessHierarchy
        (con_string.Connectionstring, configureUser.BUID);
        LogHelper.Logger.Info("Datatable filled successfully.");


}

身份验证后,我将在整个应用程序中使用的所有公共数据填充到静态类型的数据表和变量中。

4

0 回答 0