共用方式為


IHttpSessionState.LCID 屬性

定義

取得或設定目前會話的區域識別碼(LCID)。

public:
 property int LCID { int get(); void set(int value); };
public int LCID { get; set; }
member this.LCID : int with get, set
Public Property LCID As Integer

屬性值

一個 CultureInfo 具體說明當前會話文化的實例。

範例

以下程式碼範例實 LCID 作了介面取得並設定當前頁面區域識別碼的特性 IHttpSessionState

//
// Session.LCID exists only to support legacy ASP compatibility. ASP.NET developers should use
// Page.LCID instead.
//
public int LCID
{
  get { return Thread.CurrentThread.CurrentCulture.LCID; }
  set { Thread.CurrentThread.CurrentCulture = CultureInfo.ReadOnly(new CultureInfo(value)); }
}
'
    ' Session.LCID exists only to support legacy ASP compatibility. ASP.NET developers should use
' Page.LCID instead.
'
Public Property LCID As Integer Implements IHttpSessionState.LCID
  Get
    Return Thread.CurrentThread.CurrentCulture.LCID
  End Get
  Set
    Thread.CurrentThread.CurrentCulture = CultureInfo.ReadOnly(new CultureInfo(value))
  End Set
End Property

備註

LCID 特性僅用於與早期版本的 ASP 相容性。 如果你不需要維持與 ASP 頁面的向下相容,請改用該 LCID 屬性。

ASP.NET 不會在會話狀態中儲存區域識別碼。 屬性呼叫 LCID to LCID get 並設定識別碼。

適用於

另請參閱