2010-11-25 104 views

回答

2

你使用Windows身份認證和asp.net頁面作爲主機?

所以拒絕匿名用戶

<authorization> 
    <deny users="?" /> 
</authorization> 

,並使用此代碼:

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> 
... 
    <param name="initParams" value="username=<%= User.Identity.Name %>" /> 
... 
</object> 

之後解析輸入PARAMS在Silverlight應用程序:

private void Application_Startup(object sender, StartupEventArgs e) 
{ 
    var username = e.InitParams["username"]; 
    this.RootVisual = new MainPage(); 
} 

而且我ķ現在另一種方式來實現這一點(使用wcf服務),但它更復雜。

+0

我很抱歉,我很困惑你。我需要的是你登錄你的Windows系統的用戶名 – star 2010-11-25 14:15:45

相關問題