Properties Property
The Properties property of the SPVirtualServerConfig class gets configuration settings that are used on the virtual server.
Property Value
Microsoft.SharePoint.Utilities.SPPropertyBag object that contains the virtual server configuration settings. For information about the string keys represented in the property bag, see "Command-Line Properties" in the Administrator's Guide for Windows SharePoint Services.
Example
The following code example iterates through the collection of key-and-value pairs returned by the Properties property and displays each pair.
The previous example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint.Administration and Microsoft.SharePoint.Utilities namespaces.
The next example uses the Properties property to enable security validation and its expiration, as well as to set the timeout for security validation to 40 minutes.
[Visual Basic .NET]
Dim globalAdmin As New SPGlobalAdmin()
Dim vServer As SPVirtualServer = globalAdmin.OpenVirtualServer(New Uri("http://Virtual_Server"))
vServer.Config.Properties("securityvalidation-enabled") = Boolean.TrueString
vServer.Config.Properties("securityvalidation-expire") = Boolean.TrueString
vServer.Config.Properties("securityvalidation-timeout") = "40"
vServer.Config.Properties.Update()
globalAdmin.Close()
For information on how to add administrative security validation to an ASPX page, see Security Validation and Making Posts to Update Data.
Requirements
Platforms: Microsoft Windows Server 2003
Security: Code Access Security