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