ReportingService2005.SetSystemProperties(Property[]) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定一個或多個系統屬性。
public:
void SetSystemProperties(cli::array <ReportService2005::Property ^> ^ Properties);
public void SetSystemProperties(ReportService2005.Property[] Properties);
member this.SetSystemProperties : ReportService2005.Property[] -> unit
Public Sub SetSystemProperties (Properties As Property())
參數
範例
下表顯示此操作的標頭與權限資訊。
| SOAP 標頭 | (出局) ServerInfoHeaderValue |
| 必要權限 | UpdateSystemProperties (系統) |
要編譯以下程式碼範例,您必須參考 Reporting Services WSDL 並匯入特定命名空間。 欲了解更多資訊,請參閱編 譯與執行程式碼範例。 以下程式碼範例在報告伺服器資料庫中建立一個名為 Description 的新系統屬性:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim setProp As New [Property]()
setProp.Name = "Description"
setProp.Value = "My report server that resides on the computer named RSSERVER1."
Dim props(0) As [Property]
props(0) = setProp
Try
rs.SetSystemProperties(props)
Console.WriteLine("New site property set.")
Catch ex As SoapException
Console.WriteLine(ex.Detail.OuterXml)
End Try
End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;
class Sample
{
public static void Main()
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
Property setProp = new Property();
setProp.Name = "Description";
setProp.Value = "My report server that resides on the computer named RSSERVER1.";
Property[] props = new Property[1];
props[0] = setProp;
try
{
rs.SetSystemProperties( props );
Console.WriteLine( "New site property set." );
}
catch (SoapException ex)
{
Console.WriteLine( ex.Detail.OuterXml);
}
}
}
備註
使用者可以新增系統未保留的自訂系統屬性。 如果陣列中指定的 Property 屬性不存在,則會建立該屬性。 如果某個屬性存在價值,該值會被覆寫。 你無法建立或移除保留系統屬性。 根據所設定的系統屬性,報告伺服器的功能可能會有所改變。 關於保留系統屬性的清單,請參見 「報告伺服器系統屬性」。 若發生錯誤,則不設定屬性。
你可以將財產設定為空值來移除該物件的價值。