FtpClientConnection.Connect 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
서버에 연결을 열고 연결 결과를 나타내는 값을 반환합니다.
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()