2012-03-13 47 views
0

如何使用Flex/Actionscript獲取Window NT記錄的用戶名。我曾與ASP.NET實現這些憑證的工作,但我是新來的Flex的境界,需要一些幫助你如何能夠使用Flex/Actionscript獲取Window NT記錄的用戶名?

ASP.NET代碼如下

Getting the User Name : 

using three ways we can get the User Name using C# 

1) System.Security.Principal.WindowsPrincipal p = 
System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal; 

string strName = p.Identity.Name; 

[ OR ] 

2) string strName = HttpContext.Current.User.Identity.Name.ToString(); 

[ OR ] 

3) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name 

string strName = Request.ServerVariables[5]; //Finding with index 
+1

我相信這個問題應該是封閉的,因爲它是一個複製http://stackoverflow.com/questions/1376/get-the-current-logged-in-os-user-in-adobe-air – shaunhusain 2012-03-13 17:34:57

+0

感謝您的洞察力。這篇文章非常有幫助。當我搜索時,我根本沒有看到這個話題。欣賞它很多! – nholloway4 2012-03-14 21:09:39

回答

0

從來沒有見過像在空氣中的那種訪問,並不會想象你將永遠被允許(權限)在Flex

你可能使用套接字實現所需的結果? 在AIr中有一個SocketMonitor。

您可以連接到機器上的特定端口併發送和接收數據。

因此,您只能創建一個解決方法:在C#中創建一個偵聽器,並創建從此偵聽器到您的Flex應用程序的連接。

+0

我很快就會檢查這個方法。這將導致我們在應用程序體系結構上創建另一個層,以便讓您知道。雖然做到了這一點,但不會出現這種情況.... – nholloway4 2012-03-14 21:11:02

相關問題