FtpStatusCode 列舉

定義

指定檔案傳輸通訊協定 (FTP) 作業傳回的狀態碼。

public enum class FtpStatusCode
public enum FtpStatusCode
type FtpStatusCode = 
Public Enum FtpStatusCode
繼承
FtpStatusCode

欄位

AccountNeeded 532

指定伺服器上需要使用者帳戶。

ActionAbortedLocalProcessingError 451

指定發生錯誤,因此無法完成所要求的動作。

ActionAbortedUnknownPageType 551

指定所要求的動作無法執行,因為指定的頁面型別未知。 RFC 959 Section 3.1.2.3 中描述了頁面類型。

ActionNotTakenFilenameNotAllowed 553

指定在指定的檔案上無法執行所要求的動作。

ActionNotTakenFileUnavailable 550

指定在指定的檔案上無法執行所要求的動作,因為檔案無法使用。

ActionNotTakenFileUnavailableOrBusy 450

指定在指定的檔案上無法執行所要求的動作,因為檔案無法使用或正在使用。

ActionNotTakenInsufficientSpace 452

指定無法執行所要求的動作,因為伺服器上的空間不足。

ArgumentSyntaxError 501

指定一或多個命令引數有語法錯誤。

BadCommandSequence 503

指定命令的順序不正確。

CantOpenData 425

指定資料連接無法開啟。

ClosingControl 221

指定伺服器正在關閉控制連接。

ClosingData 226

指定伺服器正在關閉控制連接,並且所要求的檔案動作成功。

CommandExtraneous 202

指定伺服器未實作命令,因為不需要此命令。

CommandNotImplemented 502

指定 FTP 伺服器未實作命令。

CommandOK 200

指定命令成功完成。

CommandSyntaxError 500

指定命令有語法錯誤,或伺服器無法辨認命令。

ConnectionClosed 426

指定連線已經關閉。

DataAlreadyOpen 125

指定資料連接已經開啟,並且所要求的傳輸正在啟動。

DirectoryStatus 212

指定目錄的狀態。

EnteringPassive 227

指定伺服器正在進入被動模式。

FileActionAborted 552

指定無法執行所要求的動作。

FileActionOK 250

指定所要求的檔案動作成功完成。

FileCommandPending 350

指定所要求的檔案動作需要其他資訊。

FileStatus 213

指定檔案的狀態。

LoggedInProceed 230

指定使用者已登入並且可以傳送命令。

NeedLoginAccount 332

指定需要提供登入帳戶給伺服器。

NotLoggedIn 530

指定登入資訊必須傳送至伺服器。

OpeningData 150

指定伺服器正在開啟控制連接。

PathnameCreated 257

指定所要求的路徑名稱已建立。

RestartMarker 110

指定回應包含重新啟動標記回覆。 這個狀態所隨附的描述文字包含使用者資料流標記和伺服器標記。

SendPasswordCommand 331

指定需要提供密碼給伺服器。

SendUserCommand 220

指定伺服器可接受使用者登入作業。

ServerWantsSecureSession 234

指定伺服器接受用戶端所指定的驗證機制,並且已完成交換安全性資料。

ServiceNotAvailable 421

指定服務無法使用。

ServiceTemporarilyNotAvailable 120

指定服務目前無法使用;請稍後嘗試要求。

SystemType 215

使用 Internet Assigned Numbers Authority 所公佈之 Assigned Numbers 文件中的系統名稱,指定系統類型名稱。

Undefined 0

為了完整性而加入,伺服器絕對不會傳回這個值。

範例

下列程式碼範例會傳送 FTP 要求,以在 FTP 伺服器上建立新的目錄,並檢查回應中傳回的狀態碼。

static bool MakeDirectoryOnServer( Uri^ serverUri )
{
   // The serverUri should start with the ftp:// scheme.
   if ( serverUri->Scheme != Uri::UriSchemeFtp )
   {
      return false;
   }

   // Get the object used to communicate with the server.
   FtpWebRequest^ request = dynamic_cast<FtpWebRequest^>(WebRequest::Create( serverUri ));
   request->Method = WebRequestMethods::Ftp::MakeDirectory;
   FtpWebResponse^ response = dynamic_cast<FtpWebResponse^>(request->GetResponse());
   Console::WriteLine( "Status: {0}", response->StatusDescription );
   return true;
}
public static bool MakeDirectoryOnServer (Uri serverUri)
{
    // The serverUri should start with the ftp:// scheme.
    if (serverUri.Scheme != Uri.UriSchemeFtp)
    {
        return false;
    }

    // Get the object used to communicate with the server.
    FtpWebRequest request = (FtpWebRequest)WebRequest.Create (serverUri);
    request.KeepAlive = true;
    request.Method = WebRequestMethods.Ftp.MakeDirectory;
    FtpWebResponse response = (FtpWebResponse)request.GetResponse ();
    Console.WriteLine ("Status: {0}", response.StatusDescription);
    return true;
}

備註

列舉 FtpStatusCode 定義 屬性中 StatusCode 傳回的值。

如需 FTP 伺服器狀態碼的其他資訊,請參閱 RFC 959:「檔案傳輸通訊協定」,第 4.2 節:「FTP 回復」

適用於

另請參閱