现在的位置: 首页 > 综合 > 正文

VB写日志文件

2012年11月20日 ⁄ 综合 ⁄ 共 527字 ⁄ 字号 评论关闭

……

 

If DateDiff("n", Now, ConvByteToDate) > 9 Then

                Open "c:\\errlog.log" For Append As #1

                Print #1, "now:", Now '当前时间

                Print #1, "=>datMeasDate:", datMeasDate '接收的采集时间

                Print #1, "=>lngOffset:", lngOffset '偏移量

                Dim str As String

                Dim strresult As String

                Dim b As Integer

                For b = 0 To 13 + intDataTotal * 19 - 1

                  str = bytData(b)

                  If Len(str) = 1 Then

                    str = "0" & str

                  End If

                  strresult = strresult & str

                Next

                Print #1, "=>bytData:", strresult '整个接收内容

                Close #1

End If

 

抱歉!评论已关闭.