다음을 통해 공유


Application.FolderExistsOnDtsServer Method

Returns a Boolean that indicates whether the specified folder already exists on the file system.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Function FolderExistsOnDtsServer ( _
    sFolderName As String, _
    sServerName As String _
) As Boolean
public bool FolderExistsOnDtsServer (
    string sFolderName,
    string sServerName
)
public:
bool FolderExistsOnDtsServer (
    String^ sFolderName, 
    String^ sServerName
)
public boolean FolderExistsOnDtsServer (
    String sFolderName, 
    String sServerName
)
public function FolderExistsOnDtsServer (
    sFolderName : String, 
    sServerName : String
) : boolean

매개 변수

  • sFolderName
    The name of the folder you are looking for. For example, to see if a folder name myFolder exists under the File System folder, use the escaped string, @"\File System\myFolder".
  • sServerName
    The name of the server to search for the package.

반환 값

true if the folder specified exists on the server; false if the folder does not exist.

The following code example queries the File System to determine whether a folder that was created previously, named myFolder, exists.

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

Sample Output:

Folder exists? True

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace