示例:获取会话属性

此示例演示如何使用 TDConnection 对象获取当前会话的属性。将代码添加到需要这些属性的过程。属性不相互依赖,因此每个属性都可以单独检索。

以下是会话属性的示例:

TDConnection.ServerName
TDConnection.ServerTime
TDConnection.DomainName
TDConnection.ProjectName
User.UserName

注意,不必使用 TDConnection 检索用户名,因为工作流有预定义的 User 对象。有关详细信息,请参见TDConnection 对象

下面的示例测试服务器 URL 的前五个字符,以确定用户是用 HTTP 还是 HTTPS 连接服务器:

If Left(UCase(TDConnection.ServerName), 5) = "HTTPS" Then
        MsgBox "You are currently connected to the server using SSL."
Else
        MsgBox "You are not using SSL."
End If