共用方式為


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 會呼叫 LCID 以取得並設定識別碼。

適用於

另請參閱