FtpWebResponse.StatusDescription 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取描述从 FTP 服务器发送的状态代码的文本。
public:
 property System::String ^ StatusDescription { System::String ^ get(); };public string? StatusDescription { get; }public string StatusDescription { get; }member this.StatusDescription : stringPublic ReadOnly Property StatusDescription As String属性值
String 实例,它包含状态代码以及与此响应一起返回的消息。
示例
下面的代码示例发送删除 FTP 服务器上的文件的请求,并显示服务器对请求的响应中的状态消息。
public static bool DeleteFileOnServer(Uri serverUri)
{
    // The serverUri parameter should use the ftp:// scheme.
    // It contains the name of the server file that is to be deleted.
    // Example: ftp://contoso.com/someFile.txt.
    //
    if (serverUri.Scheme != Uri.UriSchemeFtp)
    {
        return false;
    }
    // Get the object used to communicate with the server.
    FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUri);
    request.Method = WebRequestMethods.Ftp.DeleteFile;
    FtpWebResponse response = (FtpWebResponse) request.GetResponse();
    Console.WriteLine("Delete status: {0}",response.StatusDescription);
    response.Close();
    return true;
}
注解
属性返回 StatusDescription 的文本包括 3 位 StatusCode 属性值。 下载数据时, StatusDescription FTP 服务器会返回状态代码的值更改。 调用 GetResponse 方法后, StatusDescription 包含中间状态代码。 调用 Close 方法时, StatusDescription 包含最终状态。