0
最近我重置IIS服務,我的項目停止正常工作。IIS權限/身份驗證問題
我保持了兩次身份驗證:匿名身份驗證和Windows身份驗證。
當我禁用Windows時,項目獲取訪問數據庫的錯誤。 (匿名用戶無法訪問) 當我禁用匿名時,項目保持我的Windows名稱作爲登錄名。 當我啓用時,登錄是好的,但所有頁面的用戶ID爲空。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace Worldsmart.Smart.Cardholder.Portal.Models
{
public class ClaimModel
{
public static Guid GetUserID(HttpContextBase context)
{
Guid userID;
try
{
userID = (Guid)Membership.GetUser().ProviderUserKey;
}
catch (Exception)
{
userID = new Guid();
}
return userID;
}
}
}
有沒有人可以幫助我呢?因爲當我將該項目轉移到另一臺機器時,因此問題似乎不是項目本身。
乾杯
您究竟認爲什麼是「作品」?你是否應該使用客戶端的Windows登錄訪問數據庫,或不? –