資源簡(jiǎn)介
該程序通過(guò)socan代碼生成器生成底層DAL、BLL、Model、IDAL等,通過(guò)該示例對(duì)研究三層的使用很有幫助,關(guān)于詳細(xì)說(shuō)明請(qǐng)參照代碼佩文 數(shù)據(jù)庫(kù)操作使用SqlHelper 該程序采用VS2005+Sql2000數(shù)據(jù)庫(kù)(DB下為數(shù)據(jù)庫(kù)文件,使用企業(yè)管理器附加即可)

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Collections;
using?System.Web;
using?System.Web.Caching;
namespace?BLL
{
????public?class?Caches
????{
????????///?
????????///?建立緩存
????????///?
????????public?static?object?TryAddCache(string?key?object?value?CacheItemPriority?priority)
????????{
????????????if?(HttpRuntime.Cache[key]?==?null?&&?value?!=?null)
????????????????return?HttpRuntime.Cache.Add(key?value?null?Cache.NoAbsoluteExpiration?Cache.NoSlidingExpiration?priority?null);
????????????else
????????????????return?null;
????????}
????????///?
????????///?建立定時(shí)不訪問(wèn)便移除的緩存
????????///?
????????public?static?object?TryAddCache(string?key?object?value?TimeSpan?slidingExpiration?CacheItemPriority?priority)
????????{
????????????if?(HttpRuntime.Cache[key]?==?null?&&?value?!=?null)
????????????????return?HttpRuntime.Cache.Add(key?value?null?Cache.NoAbsoluteExpiration?slidingExpiration?priority?null);
????????????else
????????????????return?null;
????????}
????????///?
????????///?建立緩存,并在移除時(shí)執(zhí)行事件
????????///?
????????public?static?object?TryAddCache(string?key?object?value?DateTime?absoluteExpiration?TimeSpan?slidingExpiration?CacheItemPriority?priority?CacheItemRemovedCallback?onRemovedCallback)
????????{
????????????if?(HttpRuntime.Cache[key]?==?null?&&?value?!=?null)
????????????????return?HttpRuntime.Cache.Add(key?value?null?absoluteExpiration?slidingExpiration?priority?onRemovedCallback);
????????????else
????????????????return?null;
????????}
????????///?
????????///?移除緩存
????????///?
????????public?static?object?TryRemoveCache(string?key)
????????{
????????????if?(HttpRuntime.Cache[key]?!=?null)
????????????????return?HttpRuntime.Cache.Remove(key);
????????????else
????????????????return?null;
????????}
????????///?
????????///?移除鍵中帶某關(guān)鍵字的緩存
????????///?
????????public?static?void?RemoveMultiCache(string?keyInclude)
????????{
????????????IDictionaryEnumerator?CacheEnum?=?HttpRuntime.Cache.GetEnumerator();
????????????while?(CacheEnum.MoveNext())
????????????{
????????????????if?(CacheEnum.Key.ToString().IndexOf(keyInclude.ToString())?>=?0)
????????????????????HttpRuntime.Cache.Remove(CacheEnum.Key.ToString());
????????????}
????????}
????????///?
????????///?移除所有緩存
????????///?
????????public?static?void?RemoveAllCache()
????????{
????????????IDictionaryEnumerator?CacheEnum?=?HttpRuntime.Cache.GetEnumerator();
????????????while?(CacheEnum.MoveNext())
????????????{
????????????????HttpRuntime.Cache.Remove(CacheEnum.Key.ToString());
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
????.......?????20480??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\BLL.dll
????.......?????26112??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\BLL.pdb
????.......?????16384??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\DALFactory.dll
????.......?????11776??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\DALFactory.pdb
????.......?????16384??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\IDAL.dll
????.......??????7680??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\IDAL.pdb
????.......?????16384??2007-07-22?15:58??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\Model.dll
????.......?????13824??2007-07-22?15:58??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug\Model.pdb
?????目錄??????????0??2007-07-26?21:54??codedn.com\MVC多層分頁(yè)源碼\BLL\bin\Debug
?????目錄??????????0??2007-07-22?14:06??codedn.com\MVC多層分頁(yè)源碼\BLL\bin
????.......??????2671??2007-07-22?14:58??codedn.com\MVC多層分頁(yè)源碼\BLL\BLL.csproj
????.......???????168??2007-07-23?19:16??codedn.com\MVC多層分頁(yè)源碼\BLL\BLL.csproj.user
????.......??????2828??2007-07-16?22:44??codedn.com\MVC多層分頁(yè)源碼\BLL\Caches.cs
????.......??????8446??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL\Category.cs
????.......???????252??2007-08-30?09:59??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\BLL.csproj.FileList.txt
????.......?????20480??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\BLL.dll
????.......?????26112??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\BLL.pdb
????.......?????16384??2007-07-22?15:38??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\Refactor\BLL.dll
?????目錄??????????0??2007-07-26?21:54??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\Refactor
????.......?????14346??2007-08-30?09:46??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\ResolveAssemblyReference.cache
?????目錄??????????0??2007-07-13?02:13??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug\TempPE
?????目錄??????????0??2007-08-30?09:46??codedn.com\MVC多層分頁(yè)源碼\BLL\obj\Debug
?????目錄??????????0??2007-07-26?21:54??codedn.com\MVC多層分頁(yè)源碼\BLL\obj
????.......??????1305??2007-07-12?22:01??codedn.com\MVC多層分頁(yè)源碼\BLL\Properties\AssemblyInfo.cs
?????目錄??????????0??2007-07-26?21:54??codedn.com\MVC多層分頁(yè)源碼\BLL\Properties
?????目錄??????????0??2007-07-26?22:04??codedn.com\MVC多層分頁(yè)源碼\BLL
????.......?????16384??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\DALFactory\bin\Debug\DALFactory.dll
????.......?????11776??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\DALFactory\bin\Debug\DALFactory.pdb
????.......?????16384??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\DALFactory\bin\Debug\IDAL.dll
????.......??????7680??2007-07-26?21:59??codedn.com\MVC多層分頁(yè)源碼\DALFactory\bin\Debug\IDAL.pdb
............此處省略144個(gè)文件信息
- 上一篇:C#做的SMTP郵件收發(fā)程序
- 下一篇:WPF DataGrid合并行
評(píng)論
共有 條評(píng)論