언어

FtpClientConnection.Connect 메서드

정의

서버에 연결을 열고 연결 결과를 나타내는 값을 반환합니다.

public:
 bool Connect();
public bool Connect();
member this.Connect : unit -> bool
Public Function Connect () As Boolean

반품

연결이 확립되면 참입니다. 연결이 성립되지 않았다면 거짓입니다.

예제

다음 코드 예시는 를 생성 FtpClientConnection하고, 연결을 획득한 후 .을 사용하여 Connect서버에 연결합니다.

Package pkg = new Package();  
FtpClientConnection ftp = null;  
Connections conns = pkg.Connections;  
ConnectionManager cm = conns.Add("FTP");  

object myConnection = cm.AcquireConnection(null);  
ftp = new FtpClientConnection(myConnection );  

// Connect up to the FTP server.    
ftp.Connect();  
Dim pkg As Package =  New Package()   
Dim ftp As FtpClientConnection =  Nothing   
Dim conns As Connections =  pkg.Connections   
Dim cm As ConnectionManager =  conns.Add("FTP")   

Dim myConnection As Object =  cm.AcquireConnection(Nothing)   
ftp = New FtpClientConnection(myConnection)  

' Connect up to the FTP server.    
ftp.Connect()  

적용 대상