| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1117 人关注过本帖
标题:不久前写的修改系统时间-源码+工具
只看楼主 加入收藏
XMeLoDy
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2007-10-4
收藏
 问题点数:0 回复次数:3 
不久前写的修改系统时间-源码+工具
修改时间.rar (9.66 KB) 源码+工具


源码:
'模块****************************************************
Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
Type SYSTEMTIME ' 16 Bytes
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 Function SetTime(ByVal sYear As Integer, _
                        ByVal sMonth As Integer, _
                        ByVal sDayW As Integer, _
                        ByVal sDay As Integer, _
                        ByVal sHour As Integer, _
                        ByVal sMin As Integer, _
                        ByVal sSecond As Integer, _
                        ByVal sMill As Integer) As Long
    Dim Syst As SYSTEMTIME
    If sHour < 8 Then '时区不同需要修改
        sHour = sHour + 16
    ElseIf sHour > 8 Then
        sHour = sHour - 8
    End If
    With Syst
   
    .wYear = sYear
    .wMonth = sMonth
    .wDayOfWeek = sDayW
    .wDay = sDay
    .wHour = sHour
    .wMinute = sMin
    .wSecond = sSecond
    .wMilliseconds = sMill
    End With
    SetSystemTime Syst
End Function
'窗体模块***********************************************************

Private Sub Command1_Click()
Dim a As Long
Dim St(5) As Integer
    For i = 0 To 5

        St(i) = Val(Form1.Text1(i))
   
    Next
   
a = SetTime(St(0), St(1), 0, St(2), St(3), St(4), St(5), 0)
'年,月,0,日,时,分钟,秒,0
End Sub

Private Sub Command2_Click()
End
End Sub


Private Sub Form_Load()
Text1(0) = Left(Now, 4)
Text1(1) = Val(Mid(Date, 6, 7))
Text1(2) = Val(Mid(Date, 9, 10))
Text1(3) = Hour(Time)
Text1(4) = Minute(Time)
Text1(5) = Second(Time)

End Sub

Private Sub Label7_Click()
    Shell "explorer [url]http://www.[/url]"
End Sub
搜索更多相关主题的帖子: Integer 源码 系统 工具 Function 
2007-12-31 15:12
??
Rank: 1
等 级:新手上路
帖 子:68
专家分:0
注 册:2007-11-24
收藏
得分:0 
好东东
2007-12-31 15:39
e3bnsd
Rank: 1
等 级:新手上路
帖 子:58
专家分:0
注 册:2007-3-29
收藏
得分:0 
挺好的。
2012-12-07 15:08
chenchencxj
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2013-2-18
收藏
得分:0 
好东西学习了
2013-02-18 16:08
快速回复:不久前写的修改系统时间-源码+工具
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032818 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved