Share via


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 インスタンス。

次のコード例では、 インターフェイスの プロパティをLCIDIHttpSessionState実装して、現在のページのロケール識別子を取得および設定します。

//
// 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 呼び出して識別子を取得および設定します。

適用対象

こちらもご覧ください