Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ServerInfo class

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

System.Object
  Microsoft.Office.InfoPath.ServerInfo

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
'Declaration
PublicMustInheritClassServerInfo
'Usage
DiminstanceAsServerInfo

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.

Dim strListUrl As String = Me.ServerInfo.SharePointListUrl.OriginalString
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.