guckst du http://eknori.dyndns.org/knowledge/devidea.nsf/Alpha/D65E491F10C037A2802568860028C383?OpenDocument
Represents a summary of user activity for a specified database.Containment Contains: NotesUserActivityEntryPropertiesUserActivityCount As LongHasUserActivity As IntegerParent As NotesDatabaseMethodsFirst as StringLast As StringUses As LongReads As LongWrites As LongPrevDayUses As LongPrevDayReads As LongPrevDayWrites As LongPrevWeekUses As LongPrevWeekReads As LongPrevWeekWrites As LongPrevMonthUses As LongPrevMonthReads As LongPrevMonthWrites As LongGetNthUserActivityEntry(EntryNumber As Long) As NotesUserActivityEntryAccess & NewThe NotesUserActivity class represents a summary of user activity for a specified database as well as providing access to individual user activity entries. User activity for the specified database must be enabled for this function to work. After creating a new instance of the NotesUserActivity object for a database you should interegate the HasUserActivity property to ensure that activity is available.InstallationCopy and paste the CLASSNotesUserActivity library from this database to your source database.In the Options section of your code include the line:Use "CLASSNotesUserActivity"SyntaxDim variableName As New NotesUserActivity( notesDatabase)orSet notesUserActivityEntry = New NotesUserActivity( notesDatabase)NotesUserActivityEntry classRepresents an User Activity Entry for a specified database.Containment Contain by: NotesUserActivityPropertiesUserName As StringReads As LongWrites As LongTime As StringMethodsNoneExampleDim db As New NotesDatabase("","")Dim ua As NotesUserActivityDim uae As NotesUserActivityEntryDim iCounter As LongCall db.OpenMailIf Not db Is Nothing ThenSet ua = New NotesUserActivity(db)If ua.HasUserActivity ThenPrint "First: " + ua.FirstPrint "Last: " + ua.LastPrint "Uses: " + Cstr(ua.Uses)Print "Uses Day: " + Cstr(ua.PrevDayUses)Print "Uses Week: " + Cstr(ua.PrevWeekUses)Print "Uses Month: " + Cstr(ua.PrevMonthUses)For iCounter = 1 To ua.UserActivityCountSet uae = ua.GetNthUserActivityEntry(iCounter)Print "(" + Cstr(iCounter) + ") " + uae.Time + " " + uae.UserName + " " + "Reads:" + Cstr(uae.Reads) + " Writes:" + Cstr(uae.Writes)Next iCounterEnd IfEnd If Code: ' ' NotesUserActivity class (R1.0)' Written by: Daniel Alvers (daniel.alvers@au.pwcglobal.com)' PricewaterhouseCoopers (Aust)' February, 14 2000' ' This code is provided as is and no warranty, express or implied, exists ' as to its fitness for use for any purpose.' You are free to use and distributed the code as long as credit is retained' and this header is not removed''Paste as a function into your codeFunction ConvertTIMEtoText(TIMESTRUCT As TIMEDATE) As StringDim spTime As String * MAXALPHATIMEDATEDim retLength As IntegerspTime = Space(MAXALPHATIMEDATE)Call ConvertTIMEDATEToText (&h0,&h0, TIMESTRUCT, spTime,MAXALPHATIMEDATE,retLength)ConvertTIMEtoText = Left(spTime,retLength)End Function'Paste into the declarations section of your codeConst MAXALPHATIMEDATE = 80Type TIMEDATEInnard1 As LongInnard2 As LongEnd TypeType DBACTIVITYFirst As TIMEDATELast As TIMEDATEUses As LongReads As LongWrites As LongPrevDayUses As LongPrevDayReads As LongPrevDayWrites As LongPrevWeekUses As LongPrevWeekReads As LongPrevWeekWrites As LongPrevMonthUses As LongPrevMonthReads As LongPrevMonthWrites As LongEnd TypeType DBACTIVITY_ENTRYTime As TIMEDATEReads As IntegerWrites As IntegerUserNameOffset As LongEnd TypeDeclare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As String, hDb As Long) As IntegerDeclare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hDb As Long) As IntegerDeclare Function W32_NSFDbGetUserActivity Lib "nnotes.dll" Alias "NSFDbGetUserActivity" ( Byval hDB As Long, Byval flags As Long, retDbActivity As DBActivity, rethUserInfo As Long, retUserCount As Long) As IntegerDeclare Function W32_OSLockObject Lib "nnotes.dll" Alias "OSLockObject" ( Byval handle) As LongDeclare Sub OSUnlockObject Lib "NNOTES.DLL" Alias "OSUnlockObject" (Byval handle)Declare Sub W32_OSMemFree Lib "NNOTES.DLL" Alias "OSMemFree" (Byval handle)Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( hpvDest As Any, Byval hpvSource As Long, Byval cbCopy As Long)Declare Sub CopyMemoryString Lib "KERNEL32" Alias "RtlMoveMemory" ( Byval hpvDest As String, Byval hpvSource As Long, Byval cbCopy As Long)Declare Sub ConvertTIMEDATEToText Lib "NNOTES.DLL" Alias "ConvertTIMEDATEToText" (Byval IntlFormat As Long,Byval TextFormat As Long, actTIMEDATE As TIMEDATE, Byval retTextBuffer As String,Byval TextBufferLength As Integer,retTextLength As Integer)Class NotesUserActivityEntryPublic UserName As StringPublic Reads As LongPublic Writes As LongPublic Time As StringEnd ClassClass NotesUserActivityPrivate hDb As LongPrivate pDbActivity As DBACTIVITYPrivate rethUserInfo As LongPrivate retUserCount As LongPrivate prvdb As NotesDatabasePrivate flgHasActivity As IntegerSub DeleteIf Me.flgHasActivity Then Call W32_OSMemFree(rethUserInfo)If hDb <> 0 Then Call W32_NSFDbClose(hDb) End SubSub New (inpNotesDatabase As NotesDatabase)Dim sDatabase As StringDim rc As Integer Me.flgHasActivity = False'Get a valid NotesDatabase to the specified database If inpNotesDatabase Is Nothing Then Error 14101, "NotesUserActivity: Database Object is invalid"Exit SubEnd IfSet prvdb = New NotesDatabase(inpNotesDatabase.Server, inpNotesDatabase.FilePath)If prvdb.Server = "" Thensdatabase = prvdb.filepathElsesdatabase = prvdb.server + "!!" + prvdb.filepathEnd If'Open the target databaserc = W32_NSFDbOpen(sDatabase,Me.hDb)If rc <> 0 ThenMe.flgHasActivity = FalseEnd If'Get the Summary User informationrc = W32_NSFDbGetUserActivity(Me.hDb, &h0, Me.pDbActivity, Me.rethUserInfo, Me.retUserCount)If rc <> 0 ThenMe.flgHasActivity = FalseEnd If Me.flgHasActivity = TrueEnd Sub 'Global TimesPublic Function First As StringFirst = ConvertTIMEtoText(pDbActivity.First) End FunctionPublic Function Last As StringLast = ConvertTIMEtoText(pDbActivity.Last) End Function'Total summaryPublic Function Uses As LongUses = pDbActivity.Uses End FunctionPublic Function Reads As LongReads = pDbActivity.Reads End FunctionPublic Function Writes As LongWrites = pDbActivity.WritesEnd Function'Day summaryPublic Function PrevDayUses As LongPrevDayUses = pDbActivity.PrevDayUses End FunctionPublic Function PrevDayReads As LongPrevDayReads = pDbActivity.PrevDayReads End FunctionPublic Function PrevDayWrites As LongPrevDayWrites = pDbActivity.PrevDayReadsEnd Function'Week summaryPublic Function PrevWeekUses As LongPrevWeekUses = pDbActivity.PrevWeekUses End FunctionPublic Function PrevWeekReads As LongPrevWeekReads = pDbActivity.PrevWeekReadsEnd FunctionPublic Function PrevWeekWrites As LongPrevWeekWrites= pDbActivity.PrevWeekWritesEnd Function'Month summaryPublic Function PrevMonthUses As LongPrevMonthUses = pDbActivity.PrevMonthUses End FunctionPublic Function PrevMonthReads As LongPrevMonthReads = pDbActivity.PrevMonthReads End FunctionPublic Function PrevMonthWrites As LongPrevMonthWrites = pDbActivity.PrevMonthWritesEnd FunctionPublic Function UserActivityCount As LongUserActivityCount = retUserCountEnd FunctionPublic Function HasUserActivity As IntegerHasUserActivity = Me.flgHasActivityEnd FunctionPublic Function Parent As NotesDatabaseSet Parent = prvdbEnd FunctionPublic Function GetNthUserActivityEntry(inpEntry As Long) As NotesUserActivityEntryDim puActivity As LongDim lEntry As LongDim puActivityEntry As DBACTIVITY_ENTRYDim StructureOffset As LongDim UsernameOffset As LongDim spUsername As String * 256Dim sUsername As StringDim nuae As New NotesUserActivityEntrylEntry = inpEntry - 1If Not Me.flgHasActivity Then Error 14104, "NotesUserActivity: No activity available"If lEntry > Me.retUserCount Or lEntry < 0 ThenError 14103, "NotesUserActivity: Subscript out of range."End If'Lock the structure get the required entrypuActivity = W32_OSLockObject(Me.rethUserInfo)StructureOffset = puActivity + (Lenb(puActivityEntry) * lEntry)Call CopyMemory (puActivityEntry, StructureOffset, Len(puActivityEntry))'Load the User name for the Activity StructureUsernameOffset = puActivity + puActivityEntry.UserNameOffsetspUsername = Space(256)Call CopyMemoryString(spUsername, UsernameOffset,Lenb(spUsername))sUserName = Left(spUsername, Instr(spUsername, Chr(0)) - 1)With nuae.UserName = sUserName.Reads = puActivityEntry.Reads.Writes = puActivityEntry.Writes.Time = ConvertTIMEtoText(puActivityEntry.Time)End WithCall OSUnlockObject(rethUserInfo)Set GetNthUserActivityEntry = nuaeEnd FunctionEnd Class
geht grad nicht auf.
Habe eben eine VPN verbindung zwischen meinem 2003 Server und unserer Checkpoint FW-1 aufbauen wollen. dabei habe ich mir die Netzwerksettings auf dem heimischen Server verbogen Jetzt komme ich aus der ferne nicht mehr dran