VB脚本的电子签名和审计追踪
VB脚本的InsertAuditEntryNew函数
函数原型:
InsertAuditEntryNew(strOldValue, strNewValue, strOpComments, iComment) |
参数:
参数 | 描述 |
strOldValue | 旧值 |
strNewValue | 新值 |
strOpComments | 注释 |
iComment |
0:将strOpComments参数的值作为注释记录到audit trial中 1:显示一个对话框,将对话框中输入的内容的作为注释记录到audit trial中 |
返回值:
- 整型值,含义未知,没有找到对此说明的官方文档。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
Function InsertAuditEntryNew(strOldValue, strNewValue, strOpComments, iComment) ' WinCC Audit Scripting PlugIn Instance Dim objWinCCAuditPlugIn 'Obtain the Audit PlugIn Set objWinCCAuditPlugIn = CreateObject( "CCAuditCollector.CCAuditScriptPlugIn.1" ) If ( Not (objWinCCAuditPlugIn Is Nothing )) Then Dim objAuditTag Set objAuditTag = Nothing Dim strTargetName Dim strApplicationUser Dim strAuditType Dim strReturnBuffer Set objAuditTag = HMIRuntime.Tags( "@local::@CurrentUser" ) strApplicationUser = objAuditTag.Read() If (Len(strApplicationUser) = 0) Then strApplicationUser = "NOT_LOGGED_ON" End If strTargetName = "VBScripting Runtime" strAuditType = "OA" Dim currentLang currentLang = HMIRuntime.Language objWinCCAuditPlugIn.SetCurrentLanguage(currentLang) Call objWinCCAuditPlugIn.InsertEntry(strApplicationUser, _ 0, _ strTargetName, _ strOldValue, _ strNewValue, _ 0, _ iComment, _ strOpComments, _ strAuditType) Else HMIRuntime.Traces(err.Description) End If 'Release the Audit PlugIn Set objWinCCAuditPlugIn = Nothing InsertAuditEntryNew = err.Description HMIRuntime.Trace(err.Description) End Function |