在 LotusScript Agent 中如何获取当前服务器的名称?

发布于 2024-07-05 16:15:36 字数 61 浏览 9 评论 0原文

在通过 WebQueryOpen 运行的 LotusScript Agent 中,如何获取当前服务器的名称?

In a LotusScript Agent that is being run via WebQueryOpen, how do you get the name of the current server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

两相知 2024-07-12 16:15:36
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
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
对风讲故事 2024-07-12 16:15:36

已经提供的示例代码很好,但我也这样做,只是获取服务器的分层名称:

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

The sample code already provided is good but I also do it this way and just get the hierarchical name of the server:

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
行雁书 2024-07-12 16:15:36

加里的回答是最合适的。 您实际上可以使用分层语法来识别服务器名称。

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 类是处理分层名称的方便对象
链接文本

Gary's answer is the most appropriate. You can actually identify the server name using hierarchical syntax to.

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   

That would be the fastest (dirtiest?) way to get the server name from the webquery open agent. The notesName class is a handy object for dealing with hierarchical names
link text

偏爱自由 2024-07-12 16:15:36
'initialize event of a WebQueryOpen agent

Dim s As New notessession   
Dim servername As String
servername = s.UserName
'initialize event of a WebQueryOpen agent

Dim s As New notessession   
Dim servername As String
servername = s.UserName
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文