在vb下用系统当前时间生成一个字符串,要精确到毫秒。
请问要如何解决?
请问要如何解决?
解决方案 »
- 请问:现我用ASP+ACCESS做成了一个留言簿,如何把这个留言簿引用到VB中操作?谢谢~!~
- 一个关于自定义控件的简单问题!
- 求教!!!vb程序安装的制作问题!!
- 关于OPENRECORDSET的问题,各位大虾帮忙啊,在线求救
- SQL语句
- 在MSHFlexGrid中插入一行有办法实现吗?
- 菜鸟问题
- 高分求教(分不够可再加)!如何读取硬件端口的数据?外部设备是打卡机。
- 我用swflash.ocx 写了一个FLASH播放器,但不知怎样联得FLASH的原始高度?
- 能回答我问题者,送本程序一个,回答后我能解决者,送源代码一份.
- 今天升上星,倾盆大泻分!
- 怎样用程序按print screen键,并保存其所截的图
Dim sysTime As SYSTEMTIME
GetSystemTime sysTime
此时systime返回当前得系统时间(毫秒级)
类型:SYSTEMTIME定义如下
Public 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
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
Public Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
dim a as SYSTEMTIME
GetLocalTime a
解析结构a即可
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 SYSTEMTIME
'Set the graphical mode to persistent
Me.AutoRedraw = True
'Get the local time
GetLocalTime MyTime
'Print it to the form
Me.Print "The Local Date is:" & MyTime.wMonth & "-" & MyTime.wDay & "-" & MyTime.wYear
Me.Print "The Local Time is:" & MyTime.wHour & ":" & MyTime.wMinute & ":" & MyTime.wSecond & ":" & MyTime.wMilliseconds
End Sub