在通过WebQueryOpen运行的LotusScript代理中,如何获取当前服务器的名称?
答案 0 :(得分:5)
Set s = New NotesSession
Set db = s.CurrentDatabase
If db.Server <> "" Then
Set sName = New NotesName(db.Server)
Else
Set sName = New NotesName(s.Username)
End If
答案 1 :(得分:1)
已提供的示例代码很好,但我也是这样做的,只是获取服务器的分层名称:
Set s = New NotesSession
Set db = s.CurrentDatabase
If db.Server <> "" Then
Set sName = New NotesName(db.Server)
Else
Set sName = New NotesName(s.Username)
End If
ServerName = sName.Abbreviated
答案 2 :(得分:0)
加里的回答是最合适的。您实际上可以使用分层语法来识别服务器名称。
dim session as new notesSession
dim strCurrServer as string
dim nmServer as notesName
strCurrServer = session.currentagent.servername
' this bit is optional
set nmServer = new notesName(strCurrServer)
' then you can do stuff like this
print nmServer.Abbreviated
这是从webquery开放代理获取服务器名称的最快(最脏?)方式。 notesName类是用于处理分层名称的便捷对象 link text
答案 3 :(得分:-3)
'initialize event of a WebQueryOpen agent
Dim s As New notessession
Dim servername As String
servername = s.UserName