用VBS读取系统当前时间!

以下是使用电脑一启动就向邮箱发送邮件!请问如何在电脑已启动前面加上当前时间!On Error Resume Nextf="use@qq.com"smtp="smtp.qq.com"u="user"p="user"t="user@qq.com"m="电脑已开机"msg="电脑已开机。"j="C:尀test.rar"NameSpace = "http://schemas.microsoft.com/cdo/configuration/"Set Email = createObject("CDO.Message")Email.From = fEmail.To = tEmail.Subject = mEmail.Textbody = msgEmail.AddAttachment jWith Email.Configuration.Fields.Item(NameSpace&"sendusing") = 2.Item(NameSpace&"smtpserver") = smtp.Item(NameSpace&"smtpserverport") = 25.Item(NameSpace&"smtpauthenticate") = 1.Item(NameSpace&"sendusername") = u.Item(NameSpace&"sendpassword") = p.updateEnd WithEmail.Send
2026年09月21日 16:21
有3个网友回答
网友(1):

获取当前时间:
代码如下:
CurrentTime=Hour(Now)&":"&Minute(Now)&":"&Second(Now)
m = "当前时间"& CurrentTime
msgbox m

获取当前日期方法一:
代码如下:

Currentdate1=date()
msgbox Currentdate1

获取当前日期方法二:
代码如下:

Currentdate2=year(Now)&"-"&Month(Now)&"-"&day(Now)
msgbox Currentdate2

网友(2):

CurrentTime=Hour(Now)&":"&Minute(Now)&":"&Second(Now)
m = CurrentTime & " 电脑已开机"
msgbox m

网友(3):

msgbox now