public FtpWebRequest(Uri inUri)
 {
     if (inUri.Scheme != "ftp")               // This class is only for ftp urls
     {
         throw new NotSupportedException("This protocol is not supported");
     }
     uri                   = inUri;
     commandType           = FtpCommandType.FtpDataReceiveCommand;   // Defaults to retrieval of a file;
     passive               = true;
     useDefaultCredentials = true;
 }
Beispiel #2
0
        /// <summary>
        /// Command creator for commands which do not contains parameters
        /// </summary>
        /// <param name="type"></param>
        /// <param name="sArray"></param>
        /// <returns></returns>
        private static FtpCommand Creater1(FtpCommandType type, string[] sArray)
        {
            FtpCommand command = null;

            if (sArray.Length == 1)
            {
                command        = new FtpCommand();
                command.m_Type = type;
            }
            return(command);
        }
Beispiel #3
0
        /// <summary>
        /// Command creator for commands which must contain a paramter
        /// </summary>
        /// <param name="type"></param>
        /// <param name="sArray"></param>
        /// <returns></returns>
        private static FtpCommand Creater2(FtpCommandType type, string[] sArray)
        {
            FtpCommand command = null;

            if (sArray.Length == 2)
            {
                command           = new FtpCommand();
                command.m_Type    = type;
                command.m_Content = sArray[1];
            }
            return(command);
        }
 /// <summary>
 /// Command creator for commands which may or may not have parameter
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sArray"></param>
 /// <returns></returns>
 private static FtpCommand Creater1or2(FtpCommandType type, string[] sArray)
 {
     FtpCommand command = null;
     if (sArray.Length == 2)
     {
         command = new FtpCommand();
         command.m_Content = sArray[1];
         command.m_Type = type;
     }
     else if (sArray.Length == 1)
     {
         command = new FtpCommand();
         command.m_Type = type;
     }
     return command;
 }
 /// <summary>
 /// Command creator for commands which do not contains parameters
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sArray"></param>
 /// <returns></returns>
 private static FtpCommand Creater1(FtpCommandType type, string[] sArray)
 {
     FtpCommand command = null;
     if (sArray.Length == 1)
     {
         command = new FtpCommand();
         command.m_Type = type;
     }
     return command;
 }
		public FtpWebRequest( Uri inUri )
		{
			if( inUri.Scheme != "ftp" )  // This class is only for ftp urls
				throw new NotSupportedException( "This protocol is not supported" );
			uri = inUri;
			commandType = FtpCommandType.FtpDataReceiveCommand; // Defaults to retrieval of a file;
			passive = true;
			useDefaultCredentials = true;
		}