SessionPageStateSection.DefaultHistorySize 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
定義頁面記錄的大小。
public: int DefaultHistorySize = 9;
public const int DefaultHistorySize = 9;
val mutable DefaultHistorySize : int
Public Const DefaultHistorySize As Integer = 9
欄位值
Value = 9範例
下列程式代碼範例示範如何從與現有 Web 應用程式相關聯的組態檔取得 DefaultHistorySize 屬性。
// Get the history size.
int historySize =
sessionPageState.HistorySize;
string msg = String.Format(
"Current history size: {0}\n",
historySize.ToString());
Console.Write(msg);
if (!sessionPageState.IsReadOnly())
{
// Double current history size.
sessionPageState.HistorySize =
2 * sessionPageState.HistorySize;
configuration.Save();
historySize =
sessionPageState.HistorySize;
msg = String.Format(
"New history size: {0}\n",
historySize.ToString());
Console.Write(msg);
}
' Get the history size.
Dim historySize As Integer = _
sessionPageState.HistorySize
Dim msg As String = _
String.Format( _
"Current history size: {0}" + _
ControlChars.Lf, historySize.ToString())
Console.Write(msg)
If Not sessionPageState.IsReadOnly() Then
' Double current history size.
sessionPageState.HistorySize = _
2 * sessionPageState.HistorySize
configuration.Save()
historySize = sessionPageState.HistorySize
msg = String.Format( _
"New history size: {0}" + _
ControlChars.Lf, historySize.ToString())
Console.Write(msg)
End If