次の方法で共有


SPGlobalAdmin.AddWPPack method

NOTE: This API is now obsolete.

Use the SPSolution class and other related solution objects to deploy Web Parts instead. (In Windows SharePoint Services 2.0, the AddWPPack method either enabled a Web Part package that was already installed on the virtual server and added it to the Web Part gallery, or installed and enabled a Web Part package and added it to the Web Part gallery, and is maintained for backward compatibility.)

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<ObsoleteAttribute("Use the SPSolution objects instead.", False)> _
Public Function AddWPPack ( _
    strPathname As String, _
    strBaseName As String, _
    nLang As UInteger, _
    strUrl As String, _
    bGlobalInstall As Boolean, _
    bForce As Boolean, _
    logWriter As TextWriter _
) As Integer
'Usage
Dim instance As SPGlobalAdmin
Dim strPathname As String
Dim strBaseName As String
Dim nLang As UInteger
Dim strUrl As String
Dim bGlobalInstall As Boolean
Dim bForce As Boolean
Dim logWriter As TextWriter
Dim returnValue As Integer

returnValue = instance.AddWPPack(strPathname, _
    strBaseName, nLang, strUrl, bGlobalInstall, _
    bForce, logWriter)
[ObsoleteAttribute("Use the SPSolution objects instead.", false)]
public int AddWPPack(
    string strPathname,
    string strBaseName,
    uint nLang,
    string strUrl,
    bool bGlobalInstall,
    bool bForce,
    TextWriter logWriter
)

Parameters

  • strPathname
    Type: System.String

    A string that contains the full file system path for the Web Part package to install. If not specified, strName must be specified. The strPathname parameter is used in conjunction with the strURL parameter. If strURL contains a null reference (Nothing in Visual Basic), the Web Part package is installed on all virtual servers on the front-end Web server; otherwise, the package is installed on the virtual server specified by strURL.

  • strBaseName
    Type: System.String

    A string that contains the file name of the installed Web Part package to enable. If not specified, strPathname must be specified. The strName parameter is used in conjunction with the strURL parameter. If strURL contains a null reference (Nothing in Visual Basic), the Web Part package is enabled for all virtual servers on the front-end Web server; otherwise, the package is enabled for the virtual server specified by strURL.

  • nLang
    Type: System.UInt32

    An unsigned 32-bit integer that specifies the locale ID for the Web Part package. This parameter can be 0 or any valid LCID (such as 1033 for English).

  • strUrl
    Type: System.String

    A string that contains the URL for the virtual server. The strURL parameter is used in conjunction with the strName or strPathname parameter. If strURL is set to a null reference (Nothing in Visual Basic), the Web Part Package specified by the strName parameter is enabled for all virtual servers on the front-end Web server, or the Web Part package specified by the strPathname parameter is installed on all virtual servers on the front-end Web server.

  • bGlobalInstall
    Type: System.Boolean

    true to install the Web Part package to each front-end Web server in a server farm; otherwise, false.

  • bForce
    Type: System.Boolean

    true to overwrite an existing Web Part package with a new version; otherwise, false.

  • logWriter
    Type: System.IO.TextWriter

    A System.IO.TextWriter object that is used to write an error log to the text stream. This parameter can contain a null reference (Nothing in Visual Basic).

Return value

Type: System.Int32

See also

Reference

SPGlobalAdmin class

SPGlobalAdmin members

Microsoft.SharePoint.Administration namespace