Here are the code.
-----------------------------------------------------------
private delegate void LoginCallback(string sUser, string sPassword);
public System.IAsyncResult BeginLogin(string sUser, string sPassword, System.AsyncCallback callback)
{
LoginCallback ftpCallback = new LoginCallback(this.Login);
return ftpCallback.BeginInvoke(sUser, sPassword,callback, null);
}
private delegate void CloseCallback();
public System.IAsyncResult BeginClose(System.AsyncCallback callback )
{
CloseCallback ftpCallback = new CloseCallback( this.Quit);
return ftpCallback.BeginInvoke(callback, null);
}