我使用的结构如下:
Structure USERREC
Public UserRecID As Integer
Public CompanyRecID As Integer
Public Username As String
Public LoggedInTime As DateTime
Public UserIsLocked As Boolean
Public UserFirstName As String
Public UserLastName As String
Public UserEmail As String
... deleted for simplicity ...
End Structure
当我将此类型实例化为一个变量(Dim ThisUserRec As USERREC = (data routine) )
时,我可以中断代码并转到即时窗口并简单地键入"? ThisUserRec"
,我会看到结构中每个元素的良好显示
? ThisuserRec
{USERREC}
UserFirstName: "Alex "
UserIsDeleted: False
UserIsLocked: False
UserIsOwnerMgr: False
在此示例中,出于安全性和简单性的目的,我删除了元素。
所以,我很想将整个结构作为字符串保存到我的审计表中。我希望有一些简单的方法,比如
Dim ThisUserRecString as String = ThisUserRec
但当然,我知道那是行不通的。
有人知道将结构内容转储到字符串中的快速方法吗?还是 HTML 表格?