Connect to the server. Throws ObjectDisposedException if this object has been disposed.
Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461
Syntax
C# |
public virtual void Connect()
|
Visual Basic |
Public Overridable Sub Connect
|
Visual C++ |
public:
virtual void Connect()
|
Implements
IFtpClient..::..Connect()()()()
Examples
C# |
Copy
|
using System;
using System.Net;
using System.Net.FtpClient;
namespace Examples {
public static class ConnectExample {
public static void Connect() {
using (FtpClient conn = new FtpClient()) {
conn.Host = "localhost";
conn.Credentials = new NetworkCredential("ftptest", "ftptest");
conn.Connect();
}
}
}
}
|
See Also