/*
* FTP Client library inC#
* Author: JaimonMathew
*mailto:jaimonmathew@rediffmail.com
*http://www.csharphelp.com/archives/archive9.html
*
* Addapted for use by Dan Glass07/03/03
*
* modify by twh07/11/21
*/
///
/// Display allcommunications to the debug log
///
publicboolVerboseDebugging
{
get
{
returnthis.verboseDebugging;
}
set
{
this.verboseDebugging=value;
}
}
///
/// Remote server port. Typically TCP21
///
publicintPort
{
get
{
returnthis.port;
}
set
{
this.port=value;
}
}
///
/// Timeout waiting for aresponse from server, in seconds.
///
publicintTimeout
{
get
{
returnthis.timeoutSeconds;
}
set
{
this.timeoutSeconds=value;
}
}
///
/// Gets and Sets the nameof the FTP server.
///
///
publicstringServer
{
get
{
returnthis.server;
}
set
{
this.server=value;
}
}
///
/// Gets and Sets the portnumber.
///
///
publicintRemotePort
{
get
{
returnthis.port;
}
set
{
this.port=value;
}
}
///
/// GetS and Sets the remotedirectory.
///
publicstringRemotePath
{
get
{
returnthis.remotePath;
}
set
{
this.remotePath=value;
}
}
///
/// Gets and Sets theusername.
///
publicstringUsername
{
get
{
returnthis.username;
}
set
{
this.username=value;
}
}
///
/// Gets and Set thepassword.
///
publicstringPassword
{
get
{
returnthis.password;
}
set
{
this.password=value;
}
}
///
/// If the value of mode is true, setbinary mode for downloads, else, Ascii mode.
///
publicboolBinaryMode
{
get
{
returnthis.binMode;
}
set
{
if(this.binMode==value)return;
if(value)
sendCommand("TYPE I");
else
sendCommand("TYPE A");
if(this.resultCode!=200)thrownewFtpException(result.Substring(4));
}
}
///
/// Login to the remoteserver.
///
publicvoidLogin()
{
if(this.loggedin)this.Close();
Debug.WriteLine("Opening connection to "+this.server,"FtpClient");