Partager via


Admin.ReadServerVersion - Méthode

Lit la version de Project Server principale, secondaire, de build et les numéros de révision.

Espace de noms :  WebSvcAdmin
Assembly :  ProjectServerServices (dans ProjectServerServices.dll)

Syntaxe

'Déclaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Admin/ReadServerVersion", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Admin/",  _
    ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Admin/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ReadServerVersion As DataSet
'Utilisation
Dim instance As Admin
Dim returnValue As DataSet

returnValue = instance.ReadServerVersion()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Admin/ReadServerVersion", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Admin/", 
    ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Admin/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public DataSet ReadServerVersion()

Valeur renvoyée

Type : System.Data.DataSet
La DataSet contient une seule table nommée ServerVersion et une ligne avec les noms de colonne WADMIN_VERSION_MAJOR, WADMIN_VERSION_MINOR, WADMIN_VERSION_BUILDet WADMIN_VERSION_REVISION.

Remarques

Autorisations Project Server

Autorisation

Description

LogOn

Permet à un utilisateur de se connecter à Project Server. Autorisation globale.

Exemples

L'exemple de méthode ProjectServerVersion renvoie une chaîne qui combine les quatre champs de la table.

using System;
using System.Data;
. . .
public string ProjectServerVersion(SvcAdmin.Admin admin)
{
    string major, minor, build, revision;
    string version = "";

    DataSet dsInfo = admin.ReadServerVersion();

    DataRow row = dsInfo.Tables["ServerVersion"].Rows[0];
    major = row["WADMIN_VERSION_MAJOR"].ToString();
    minor = row["WADMIN_VERSION_MINOR"].ToString();
    build = row["WADMIN_VERSION_BUILD"].ToString();
    revision = row["WADMIN_VERSION_REVISION"].ToString();

    build = build.Insert(build.Length - 4, ".");

    version = major + "." +
        minor + "." +
        build + ", rev. " +
        revision;
    return version;
}

Dans l'exemple, l'espace de noms du service Web d'administration de la PSI est AdminWebSvc. Le paramètre admin est une variable de classe qui est définie dans la classe appelante, comme suit :

public static AdminWebSvc.Admin admin = new WebSvcAdmin.Admin();
. . .
    string ver = ProjectServerVersion(admin);

Par exemple, ProjectServerVersion renvoie la chaîne suivante pour la version finale du Microsoft Project Server 2010: 14.0.4750.1000, rev. 15

Voir aussi

Référence

Admin classe

Admin - Membres

WebSvcAdmin - Espace de noms