我已經開發出一種web portal
,問題是沒有允許在同一時間多次登錄在ASP網站
它不允許在同一時間許多連接。當新用戶登錄時,以前的會話會自動銷燬。
我已經部署了該項目,但它是沒有用的,因爲它只允許一個用戶登錄。
這裏是我使用該connectionstring
:
<connectionstrings>
<add name="ABCConnectionString" connectionString="Data Source=435.632.653.322\SQLEXPRESS;Initial Catalog=ABC;User ID=sa;Password=abcabc" providerName="System.Data.SqlClient" />
</connectionstrings>
如果登錄成功的話,填充類:
Login_Info.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for Login_Info
/// </summary>
public class Login_Info : System.Web.UI.Page
{
public Login_Info()
{
//
// TODO: Add constructor logic here
//
}
private string name;
public string Name
{
get { return HttpContext.Current.Application["name"] as string; }
set { HttpContext.Current.Application["name"] = value; }
}
private string empID;
public string EmpID
{
get { return HttpContext.Current.Application["empID"] as string; }
set { HttpContext.Current.Application["empID"] = value; }
}
private string role;
public string Role
{
get { return HttpContext.Current.Application["role"] as string; }
set { HttpContext.Current.Application["role"] = value; }
}
private string email;
public string Email
{
get { return HttpContext.Current.Application["email"] as string; }
set { HttpContext.Current.Application["Email"] = value; }
}
}
類填充是這樣的:
var login="from a in.......";
Session["portal"] = login.Email;
Role = login.role.ToString();
Name = login.Name;
EmpID = login.ID.ToString();
Email = login.Email;
您是否收到錯誤訊息?使用什麼登錄方法? – cederlof
這裏有多種因素,您使用的是哪種身份驗證,是否有任何異常被拋出?你如何處理會議?這對我來說就像有一個靜態類,每當用戶登錄時都會被設置。 –
@cederlof ...不,不會引發任何消息。 –