Edit

Share via


ServerInfo Class

Definition

Provides information about the SharePoint Foundation server where a form is located.

public ref class ServerInfo abstract
public abstract class ServerInfo
type ServerInfo = class
Public MustInherit Class ServerInfo
Inheritance
ServerInfo

Remarks

If the form template was published to a SharePoint Foundation server, the members of the ServerInfo class can be used to determine information about where the form is published, such as the URL of the document library where the form is located. To access the ServerInfo object associated with the current form, use the ServerInfo property of the XmlForm class.

In a managed code form template created using the object model provided by the members of the Microsoft.Office.InfoPath namespace, you can use the this (C#) or Me (Visual Basic) keyword in your form code to access the members of the XmlForm class directly (without requiring an object variable that establishes a reference to the XmlForm class).

For example, the following code example uses the this or Me keyword to access the ServerInfo object associated with the current form, and then uses the SharePointListUrl property to create a string variable that contains the URL of the document library where the form is located.

string strListUrl = <span class="label">this</span>.ServerInfo.SharePointListUrl.OriginalString; Dim strListUrl As String = <span class="label">Me</span>.ServerInfo.SharePointListUrl.OriginalString

Constructors

ServerInfo()

Properties

SharePointListUrl

Gets a Uri that provides the URL of the document library where the form is located.

SharePointServerRootUrl

Gets a Uri that provides the root URL of the SharePoint server where the form is located.

SharePointSiteCollectionUrl

Gets a Uri that provides the URL of the SharePoint site collection where the form is located.

SharePointSiteUrl

Gets a Uri that provides the URL of the SharePoint site where the form is located.

Applies to