2012-01-11 42 views
0

我只是想知道如何實現System.Web.Security.FormsAuthentication類。因此,我在Reflector中打開了C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0 \ System.Web.dll,但是此類方法未顯示任何代碼。這個類不是來自任何其他類和它的密封類。如果我在反射鏡中看到如下的空白代碼,這是什麼意思?在這種情況下,登錄和註銷功能如何實際工作。FormsAuthentication類是如何實現的?如何看到它的來源?

public static void SetAuthCookie(string userName, bool createPersistentCookie) 
{ 
} 

public static void SignOut() 
{ 
} 
+0

http://www.dotnetframework.org/default.aspx/[email protected]/[email protected]/untmp/DEVDIV_TFS/Dev10/Releases/RTMRel/ndp/fx/src/xsp/System/Web/Security/FormsAuthentication @ cs/1305376/FormsAuthentication @ cs – adt 2013-11-04 07:02:36

回答

2

參考程序集僅包含元數據,而不包含實際代碼(Visual Studio在引用程序集時主要使用這些代碼)。

使用反射器,你需要做文件|打開全局程序集緩存並從那裏獲取System.Web,然後從參考程序集中卸載另一個System.Web。

+0

就是這樣。謝謝 – 2012-01-11 19:25:01