Compartilhar via


SPIisWebSite Class

Represents an Internet Information Services (IIS) Web site.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPMetabaseObject
    Microsoft.SharePoint.Administration.SPIisWebSite

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<UpgradableAttribute> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPIisWebSite _
    Inherits SPMetabaseObject
'Usage
Dim instance As SPIisWebSite
[UpgradableAttribute]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPIisWebSite : SPMetabaseObject

Remarks

Use the SPIisWebSite constructor to return an IIS Web site.

Examples

The following example modifies the description that is used for an IIS Web site.

Dim uri As New Uri("http://MyServer:999")
Dim webApp As SPWebApplication = SPWebApplication.Lookup(uri)

Dim instID As Integer = webApp.IisSettings(SPUrlZone.Default).PreferredInstanceId
Dim iisWebSite As New SPIisWebSite(instID)
iisWebSite.ServerComment = "MyDescription"
iisWebSite.Update()
Uri uri = new Uri("http://MyServer:999");
SPWebApplication webApp = SPWebApplication.Lookup(uri);

int instID = webApp.IisSettings[SPUrlZone.Default].PreferredInstanceId;
SPIisWebSite iisWebSite = new SPIisWebSite(instID);
iisWebSite.ServerComment = "MyDescription";
iisWebSite.Update();

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPIisWebSite Members

Microsoft.SharePoint.Administration Namespace