Compartir a través de


IVsWebFavorites.AddFavorite Method

Add an item to the Favorites list.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function AddFavorite ( _
    lpszURL As String, _
    lpszName As String, _
    pszIconFileName As String, _
    iIconIndex As Integer, _
    <OutAttribute> pbstrFilename As String() _
) As Integer
int AddFavorite(
    string lpszURL,
    string lpszName,
    string pszIconFileName,
    int iIconIndex,
    string[] pbstrFilename
)
int AddFavorite(
    [InAttribute] String^ lpszURL, 
    [InAttribute] String^ lpszName, 
    [InAttribute] String^ pszIconFileName, 
    [InAttribute] int iIconIndex, 
    [OutAttribute] array<String^>^ pbstrFilename
)
abstract AddFavorite : 
        lpszURL:string * 
        lpszName:string * 
        pszIconFileName:string * 
        iIconIndex:int * 
        pbstrFilename:string[] byref -> int
function AddFavorite(
    lpszURL : String, 
    lpszName : String, 
    pszIconFileName : String, 
    iIconIndex : int, 
    pbstrFilename : String[]
) : int

Parameters

  • lpszURL
    Type: String

    [in] Pointer to a string containing the URL to add.

  • lpszName
    Type: String

    [in] Pointer to a string containing the default display name.

  • pszIconFileName
    Type: String

    [in] Pointer to string containing the name of the file containing the icon to display next to the URL. May be nulla null reference (Nothing in Visual Basic).

  • iIconIndex
    Type: Int32

    [in] Integer. The index of the icon within the file given in pszIconFileName.

  • pbstrFilename
    Type: array<String[]

    [out] Pointer to the file containing the shortcut to the favorite. May be nulla null reference (Nothing in Visual Basic).

Return Value

Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsbrowse.idl:

HRESULT IVsWebFavorites::AddFavorite(
   [in] LPCOLESTR lpszURL, 
   [in] LPCOLESTR lpszName, 
   [in] LPCOLESTR pszIconFileName, 
   [in] int iIconIndex, 
   [out] BSTR * pbstrFileName
);

.NET Framework Security

See Also

Reference

IVsWebFavorites Interface

Microsoft.VisualStudio.Shell.Interop Namespace