请教在VB中如何取得精确到毫秒的时间???

解决方案 »

  1.   

    Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)Private Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
    End Type
    Private Sub Form_Load()
    Dim myTime As SYSTEMTIMEGetSystemTime myTimeMe.AutoRedraw = TrueWith myTime
    Print "当前时间:" & .wYear & "年" & .wMonth & "月" & .wDay & "日" & " " & _
          .wHour & "时" & .wMinute & "分" & .wSecond & "." & .wMilliseconds & "秒"
    End With
    End Sub