Proprietà InternetPassword
Specifica la password utilizzata per la connessione ad Agente server di SQL Server Compact 3.5.
Spazio dei nomi: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)
Sintassi
'Dichiarazione
Public Property InternetPassword As String
Get
Set
'Utilizzo
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)
Valore proprietà
Tipo: System. . :: . .String
Stringa della password di Internet Information Services (IIS). Per impostazione predefinita non è prevista alcuna password.
Osservazioni
La proprietà InternetPassword è obbligatoria se Agente server di SQL Server Compact 3.5 è configurato per l'utilizzo dell'autenticazione di base o integrata di Windows. Quando viene utilizzata l'autenticazione integrata di Windows, InternetPassword non viene passato attraverso la rete.
Quando viene utilizzata l'autenticazione di base, è necessario configurare IIS affinché venga utilizzata la crittografia Secure Sockets Layer (SSL) o Private Communication Technology (PCT) per la sicurezza della password utente. Se non viene impostata la crittografia SSL o PCT, l'autenticazione di base prevede che le password vengano trasmesse sulla rete in un formato facilmente decrittografabile. Poiché in questo caso la sicurezza viene meno, utilizzare sempre la crittografia SSL o PCT per proteggere le password quando si utilizza l'autenticazione di base.
Esempi
Nell'esempio riportato di seguito viene impostata la proprietà InternetPassword dell'oggetto SqlCeReplication.
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();
}