0
我在C#中有以下代碼。它運作良好。無法在F中將IIdentity轉換爲WindowsIdentity#
WindowsIdentity winId = (WindowsIdentity)HttpContext.Current.User.Identity;
WindowsImpersonationContext ctx = winId.Impersonate();
ctx.Undo();
但我想轉換F#代碼。我寫了下面的代碼。
Let winId = HttpContext.Current.User.Identity :> WindowsIdentity //Showing error
Let ctx = winId.Impersonate()
ctx.Undo()
在上面的代碼HttpContext.Current.User.Identity
不在WindowsIdentity
能夠鑄造。請讓我知道我該怎麼做。