Application.FolderExistsOnDtsServer(String, String) Metodo

Definizione

Restituisce un booleano che indica se la cartella specificata esiste già nel file system.

public:
 bool FolderExistsOnDtsServer(System::String ^ sFolderName, System::String ^ sServerName);
public bool FolderExistsOnDtsServer(string sFolderName, string sServerName);
member this.FolderExistsOnDtsServer : string * string -> bool
Public Function FolderExistsOnDtsServer (sFolderName As String, sServerName As String) As Boolean

Parametri

sFolderName
String

Il nome della cartella che stai cercando. Ad esempio, per verificare se esiste un nome di cartella "myFolder" nella cartella File System, usa la stringa sfuggita, @"\File System\myFolder".

sServerName
String

Il nome del server per cercare il pacchetto.

Valori restituiti

vero se la cartella specificata esiste sul server; false se la cartella non esiste.

Esempio

Il seguente esempio di codice interroga il File System per determinare se esiste una cartella precedentemente creata, chiamata myFolder, ().

class PackageTest  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package p = app.LoadPackage(pkg, null);  

            String folderName = @"\File System\myFolder";  
            String serverName = "yourserver";  
            Boolean folderExists = app.FolderExistsOnDtsServer(folderName, serverName);  
            Console.WriteLine("Folder exists? " + folderExists);  
        }  
    }  
Class PackageTest  
        Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim p As Package =  app.LoadPackage(pkg,Nothing)   

            Dim folderName As String =  "\File System\myFolder"   
            Dim serverName As String =  "yourserver"   
            Dim folderExists As Boolean =  app.FolderExistsOnDtsServer(folderName,serverName)   
            Console.WriteLine("Folder exists? " + folderExists)  
        End Sub  
End Class  

Output di esempio:

Folder exists? True

Si applica a