我試圖實現使用此示例微軟的會話狀態提供:樣品會話狀態存儲提供商 - 微軟實例
http://msdn.microsoft.com/en-us/library/ms178589.aspx
但我不能編譯它,因爲.NET拋出這樣的錯誤:
Error 1
'Project.Session.OdbcSessionStateStore' does not implement inherited abstract member 'System.Web.SessionState.SessionStateStoreProviderBase.CreateNewStoreData(System.Web.HttpContext, int)'
Error 2 'Project.Session.OdbcSessionStateStore.CreateNewStoreData(System.Web.HttpContext, double)' is a new virtual member in sealed class 'Project.Session.OdbcSessionStateStore'
Error 3 'Project.Session.OdbcSessionStateStore.CreateNewStoreData(System.Web.HttpContext, double)': no suitable method found to override
與CreateNewStoreData倍率精確的代碼:
//
// SessionStateProviderBase.CreateNewStoreData
//
public override SessionStateStoreData CreateNewStoreData(
HttpContext context,
double timeout)
{
return new SessionStateStoreData(new SessionStateItemCollection(),
SessionStateUtility.GetSessionStaticObjects(context),
(int)timeout);
}
Thx很多,你解決了我的問題。 – nikoskip 2013-04-28 18:56:05