InternetPassword プロパティ

SQL Server Compact 3.5 サーバー エージェントに接続するときに使用するパスワードを指定します。

名前空間:  System.Data.SqlServerCe
アセンブリ:  System.Data.SqlServerCe (System.Data.SqlServerCe.dll)

構文

'宣言
Public Property InternetPassword As String
    Get
    Set
'使用
Dim instance As SqlCeReplication
Dim value As String

value = instance.InternetPassword

instance.InternetPassword = value
public string InternetPassword { get; set; }
public:
property String^ InternetPassword {
    String^ get ();
    void set (String^ value);
}
member InternetPassword : string with get, set
function get InternetPassword () : String
function set InternetPassword (value : String)

プロパティ値

型: System. . :: . .String
インターネット インフォメーション サービス (IIS) のパスワード文字列。既定では、パスワードはありません。

説明

SQL Server Compact 3.5 サーバー エージェントが基本認証または統合 Windows 認証を使用するように設定されている場合、InternetPassword プロパティは必須です。統合 Windows 認証を使用する場合、InternetPassword は、ネットワーク経由では渡されません。

基本認証を使用する場合は、SSL (Secure Sockets Layer) または PCT (Private Communication Technology) 暗号化を使用するように IIS を設定して、ユーザー パスワードを保護する必要があります。SSL または PCT 暗号化を使用せずに基本認証を使用すると、簡単に復号可能な形式でパスワードがネットワーク上に送信されます。これは危険なため、基本認証を使用する場合は、必ず SSL または PCT 暗号化を使用してパスワードを保護してください。

使用例

SqlCeReplication オブジェクトの InternetPassword プロパティを設定する例を次に示します。

Dim repl As SqlCeReplication = Nothing

Try
    ' Instantiate and configure SqlCeReplication object
    '
    'NOTE: when possible, prompt users to enter security 
    'credentials at runtime. If you store credentials in a file, 
    'you must secure the file to prevent unauthorized access.
    '
    repl = New SqlCeReplication()
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll"
    repl.InternetLogin = "MyInternetLogin"
    repl.InternetPassword = "<enterStrongPassword>"
    repl.Publisher = "MyPublisher"
    repl.PublisherDatabase = "MyPublisherDatabase"
    repl.PublisherLogin = "MyPublisherLogin"
    repl.PublisherPassword = "<enterStrongPassword>"
    repl.Publication = "MyPublication"
    repl.Subscriber = "MySubscriber"
    repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf"

    ' Create the local SQL Mobile Database subscription
    '
    repl.AddSubscription(AddOption.CreateDatabase)

    ' Synchronize to the SQL Server to populate the Subscription 
    '
    repl.Synchronize()
Catch
    ' Handle errors here
    '
Finally
    ' Dispose the repl object
    '
    repl.Dispose()
End Try
SqlCeReplication repl = null;

try
{
    // Instantiate and configure SqlCeReplication object
    //
    //NOTE: when possible, prompt users to enter security 
    //credentials at runtime. If you store credentials in a file, 
    //you must secure the file to prevent unauthorized access.
    //
    repl = new SqlCeReplication();
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll";
    repl.InternetLogin = "MyInternetLogin";
    repl.InternetPassword = "<enterStrongPassword>";
    repl.Publisher = "MyPublisher";
    repl.PublisherDatabase = "MyPublisherDatabase";
    repl.PublisherLogin = "MyPublisherLogin";
    repl.PublisherPassword = "<enterStrongPassword>";
    repl.Publication = "MyPublication";
    repl.Subscriber = "MySubscriber";
    repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf";

    // Create a local SQL Mobile Database subscription
    //
    repl.AddSubscription(AddOption.CreateDatabase);

    // Synchronize to the SQL Server database
    //
    repl.Synchronize();
}
catch (SqlCeException)
{
    // Handle errors here
    //
}
finally
{
    // Dispose the repl object
    //
    repl.Dispose();
}

関連項目

参照

SqlCeReplication クラス

SqlCeReplication メンバー

System.Data.SqlServerCe 名前空間