FtpWebRequest.EnableSsl プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > FtpWebRequest.EnableSsl プロパティの意味・解説 

FtpWebRequest.EnableSsl プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

SSL 接続使用する必要があるかどうか指定する Boolean取得または設定します

名前空間: System.Net
アセンブリ: System (system.dll 内)
構文構文

Dim instance As FtpWebRequest
Dim value As Boolean

value = instance.EnableSsl

instance.EnableSsl = value
public bool EnableSsl { get;
 set; }
/** @property */
public boolean get_EnableSsl ()

/** @property */
public void set_EnableSsl (boolean value)

プロパティ
制御およびデータ伝送暗号化されている場合trueそれ以外場合false既定値false です。

例外例外
例外種類条件

InvalidOperationException

FTP サーバーへの接続が既に確立されています。

解説解説
使用例使用例

暗号化接続使用して FTP サーバーからディレクトリ一覧をダウンロードするコード例次に示します

public static bool ListFilesOnServerSsl(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.Method = WebRequestMethods.Ftp.ListDirectory;
    request.EnableSsl = true;
    
    // Get the ServicePoint object used for this request, and limit
 it to one connection.
    // In a real-world application you might use the default number
 of connections (2),
    // or select a value that works best for your application.
    
    ServicePoint sp = request.ServicePoint;
    Console.WriteLine("ServicePoint connections = {0}.", sp.ConnectionLimit);
    sp.ConnectionLimit = 1;
    
    FtpWebResponse response = (FtpWebResponse) request.GetResponse();
     Console.WriteLine("The content length is {0}", response.ContentLength);
    // The following streams are used to read the data returned from
 the server.
    Stream responseStream = null;
    StreamReader readStream = null;
    try
    {
        responseStream = response.GetResponseStream(); 
        readStream = new StreamReader(responseStream, System.Text.Encoding.UTF8);
 
        if (readStream != null)
        {
            // Display the data received from the server.
            Console.WriteLine(readStream.ReadToEnd());
        } 
        Console.WriteLine("List status: {0}",response.StatusDescription);
            
    }
    finally
    {
        if (readStream != null)
        {
            readStream.Close();
        }
        if (response != null)
        {
            response.Close();
        }
    }
   

    Console.WriteLine("Banner message: {0}", 
        response.BannerMessage);

    Console.WriteLine("Welcome message: {0}", 
        response.WelcomeMessage);

    Console.WriteLine("Exit message: {0}", 
        response.ExitMessage);
    return true;
}
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FtpWebRequest クラス
FtpWebRequest メンバ
System.Net 名前空間
FtpWebResponse
FtpStatusCode 列挙
WebRequestMethods.Ftp
WebRequest
WebResponse
WebClient


このページでは「.NET Framework クラス ライブラリ リファレンス」からFtpWebRequest.EnableSsl プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からFtpWebRequest.EnableSsl プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からFtpWebRequest.EnableSsl プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

FtpWebRequest.EnableSsl プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FtpWebRequest.EnableSsl プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS