Condividi tramite


Metodo Folder2.Sync

Sincronizza tutti i file offline nella cartella.

Sintassi

iRetVal = Folder2.Synchronize()

Parametri

Questo metodo non presenta parametri.

Commenti

Per usare questo metodo, è necessario abilitare la funzionalità File offline.

Esempio

Nell'esempio seguente viene illustrato l'uso appropriato di Sync per JScript, VBScript e Visual Basic.

Jscript:

<script language="JScript">
    function fnSynchronizeJ()
    {
        var objShell   = new ActiveXObject("shell.application");
        var objFolder2 = new Object;
        
        objFolder2 = objShell.NameSpace("\\\\server\\share\\folder");
        if (objFolder2 != null)
        {
            objFolder2.Synchronize();
        }
    }
</script>

Vbscript:

<script language="VBScript">
    function fnSynchronizeVB()
        dim objShell
        dim objFolder2
       
        set objShell = CreateObject("shell.application")
        set objFolder2 = objShell.NameSpace("\\server\share\folder")

        if (not objFolder2 is nothing) then
            objFolder2.Synchronize
        end if

        set objFolder = nothing
        set objShell = nothing
    end function
</script>

Visual Basic:

Private Sub fnSynchronizeVB()
    Dim objShell   As Shell
    Dim objFolder2 As Folder2
    
    Set objShell = New Shell
    Set objFolder2 = objShell.NameSpace("\\server\share\folder")

    If (Not objFolder2 Is Nothing) Then
        objFolder2.Synchronize
    End If

    Set objFolder2 = Nothing
    Set objShell = Nothing
End Sub

Requisiti

Requisito Valore
Client minimo supportato
Windows 2000 Professional, Windows XP [solo app desktop]
Server minimo supportato
Windows Server 2003 [solo app desktop]
Intestazione
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versione 5.0 o successiva)

Vedi anche

Cartella2

Cartella