FtpClientConnection.ServerName Properti

Definisi

Mendapatkan atau mengatur nama server Protokol Transfer File (FTP).

public:
 property System::String ^ ServerName { System::String ^ get(); void set(System::String ^ value); };
public string ServerName { get; set; }
member this.ServerName : string with get, set
Public Property ServerName As String

Nilai Properti

String yang berisi nama server FTP.

Contoh

Metode paling umum untuk membuat koneksi klien FTP adalah dengan menggunakan ConnectionManager. InnerObject berisi koneksi, dan semua properti koneksi tertentu yang terkandung oleh ConnectionManager dapat diakses melalui Properties koleksi. Contoh kode berikut menunjukkan pembuatan koneksi FTP menggunakan pengelola koneksi, dan mengatur properti menggunakan Properties koleksi.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class mySqlServer_Sample  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            FtpClientConnection ftp = null;  
            Connections conns = pkg.Connections;  
            ConnectionManager cm = conns.Add("FTP");  

            // Display the default values of the FTP connection properties.  
            // Some properties are not shown as they are write-only.  
            Console.WriteLine("ChunkSize:      {0}", cm.Properties["ChunkSize"].GetValue(cm));  
            Console.WriteLine("Retries:        {0}", cm.Properties["Retries"].GetValue(cm));  
            Console.WriteLine("ServerName:     {0}", cm.Properties["ServerName"].GetValue(cm));  
            Console.WriteLine("ServerPort:     {0}", cm.Properties["ServerPort"].GetValue(cm));  
            Console.WriteLine("ServerUserName: {0}", cm.Properties["ServerUserName"].GetValue(cm));  
            Console.WriteLine("Timeout:        {0}", cm.Properties["Timeout"].GetValue(cm));  
            Console.WriteLine("UsePassiveMode: {0}",cm.Properties["UsePassiveMode"].GetValue(cm));  

            Console.WriteLine();  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.FileSystemTask  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class mySqlServer_Sample  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim ftp As FtpClientConnection =  Nothing   
            Dim conns As Connections =  pkg.Connections   
            Dim cm As ConnectionManager =  conns.Add("FTP")   

            ' Display the default values of the FTP connection properties.  
            ' Some properties are not shown as they are write-only.  
            Console.WriteLine("ChunkSize:      {0}", cm.Properties("ChunkSize").GetValue(cm))  
            Console.WriteLine("Retries:        {0}", cm.Properties("Retries").GetValue(cm))  
            Console.WriteLine("ServerName:     {0}", cm.Properties("ServerName").GetValue(cm))  
            Console.WriteLine("ServerPort:     {0}", cm.Properties("ServerPort").GetValue(cm))  
            Console.WriteLine("ServerUserName: {0}", cm.Properties("ServerUserName").GetValue(cm))  
            Console.WriteLine("Timeout:        {0}", cm.Properties("Timeout").GetValue(cm))  
            Console.WriteLine("UsePassiveMode: {0}",cm.Properties("UsePassiveMode").GetValue(cm))  

            Console.WriteLine()  
        End Sub  
    End Class  
End Namespace  

Contoh Output:

Ukuran Potongan: 1

Percobaan ulang: 5

ServerName:

ServerPort: 21

ServerUserName:

Waktu habis: 60

UsePassiveMode: False

Berlaku untuk