'类结束 Private Sub Class_Terminate() If IsObject(Conn) Then 'Conn.Close Set Conn = Nothing End If End Sub
Public Property Let Name(ByVal vNewValue) LocalCacheName = LCase(vNewValue) End Property Public Property Let Value(ByVal vNewValue) If LocalCacheName > "" Then ReDim Cache_Data(2) Cache_Data(0) = vNewValue Cache_Data(1) = Now() Application.Lock Application(CacheName "_" LocalCacheName) = Cache_Data Application.UnLock Else Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName." End If End Property Public Property Get Value() If LocalCacheName > "" Then Cache_Data = Application(CacheName "_" LocalCacheName) If IsArray(Cache_Data) Then Value = Cache_Data(0) Else Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " The Cache_Data(" LocalCacheName ") Is Empty." End If Else Err.Raise vbObjectError + 1, "Mesky.Cn CacheServer", " please change the CacheName." End If End Property Public Function ObjIsEmpty() ObjIsEmpty = True Cache_Data = Application(CacheName "_" LocalCacheName) If Not IsArray(Cache_Data) Then Exit Function If Not IsDate(Cache_Data(1)) Then Exit Function If DateDiff("s", CDate(Cache_Data(1)), Now()) (60 * Reloadtime) Then ObjIsEmpty = False End Function Public Sub DelCahe(MyCaheName) Application.Lock Application.Contents.Remove (CacheName "_" MyCaheName) Application.UnLock End Sub
'加载系统配置信息 Public Sub LoadSetting() Dim Rs 'If Not IsObject(Conn) Then ConnectionDatabase Set Rs = Execute("Select Setting From Mesky_Setting where isDefault=1") ArrSetting = Split(Rs("Setting"), "{$}") Set Rs = Nothing system = Split(ArrSetting(144), ",") ResLicence = Split(ArrSetting(141), ",") ResLanguage = Split(ArrSetting(142), ",") ResType = Split(ArrSetting(143), ",") UserClass = Split(ArrSetting(140), ",") Name = "StyleName" If ObjIsEmpty Then Call ReloadTemplates End Sub Public Function Setting(s) Setting = ArrSetting(s) End Function Public Sub ReloadTemplates() Dim Rs, i Set Rs = Execute("select top 1 * from Mesky_Style where isDefault =1") If Not (Rs.EOF And Rs.BOF) Then For i = 2 To Rs.Fields.Count - 3 Name = Rs(i).Name 'Response.Write(Rs(i).Name) Value = Rs(i).Value Next End If Set Rs = Nothing End Sub