Bagikan melalui


Application.FolderExistsOnDtsServer(String, String) Metode

Definisi

Mengembalikan Boolean yang menunjukkan apakah folder yang ditentukan sudah ada pada sistem file.

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

Parameter

sFolderName
String

Nama folder yang Anda cari. Misalnya, untuk melihat apakah nama folder "myFolder" ada di bawah folder Sistem File, gunakan string escaped, @"\File System\myFolder".

sServerName
String

Nama server untuk mencari paket.

Mengembalikan

true jika folder yang ditentukan ada di server; false jika folder tidak ada.

Contoh

Contoh kode berikut meminta Sistem File untuk menentukan apakah folder yang dibuat sebelumnya, bernama myFolder, ada.

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  

Contoh Output:

Folder exists? True

Berlaku untuk