SqlCeReplication.InternetPassword Property
指定連接至「SQL Server Compact 3.5 伺服器代理程式」時使用的密碼。
命名空間: System.Data.SqlServerCe
組件: System.Data.SqlServerCe (在 system.data.sqlserverce.dll)
語法
'宣告
Public Property InternetPassword As String
public string InternetPassword { get; set; }
public:
property String^ InternetPassword {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_InternetPassword ()
/** @property */
public void set_InternetPassword (String value)
public function get InternetPassword () : String
public function set InternetPassword (value : String)
屬性值
「網際網路資訊服務」(IIS) 密碼字串。預設為沒有密碼。
備註
如果「SQL Server Compact 3.5 伺服器代理程式」是設定為使用「基本驗證」或「整合式 Windows 驗證」,則需要 InternetPassword 屬性。使用「整合式 Windows 驗證」時,InternetPassword 不會透過網路傳遞。
使用「基本驗證」時,您應該將 IIS 設定成使用安全通訊端層 (SSL) 或 Private Communication Technology (PCT) 加密,以保護使用者的密碼。如果未使用 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();
}
執行緒安全性
任何公用靜態 (共用 在 Microsoft Visual Basic) 此型別的成員具備執行緒安全。不保證任何執行個體成員安全執行緒。
平台
開發平台
Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
版本資訊
.NET Framework 及 NET Compact Framework
支援於 3.5
.NET Framework
支援於 3.0
.NET Compact Framework 及 .Net Framework
支援於 2.0
另請參閱
參考
SqlCeReplication Class
SqlCeReplication Members
System.Data.SqlServerCe Namespace