首先,要感谢网友“小虎”,我是在网上看了他写的一篇关于用VB 6.0编写DLL组件FOR ASP的文章改写的,他的DLL代码只实现了改写小时和分钟,我增加了年、月、日、秒的修改。
首先,在VB 6.0中建立一个ActiveX Dll工程项目,信息如下:
工程名称:systimeset
类模块名称:timeset
VB 6.0的类模块代码如下:
复制代码 代码如下:
Option Explicit
Private SystemTime As SystemTime
Private Declare Function SetSystemTime()Function SetSystemTime Lib "kernel32" (lpSystemTime As SystemTime) As Long
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
Dim tmp
Private m_Hour As Integer
Private m_Minute As Integer
Private m_Year As Integer
Private m_Month As Integer
Private m_Day As Integer
Private m_Second As Integer
'由李锡远修改 修改日期:2006-08-31 修改项目:增加对年、月、日、秒的操作
'--------------------
'年
Public Property Get()Property Get Year() As Integer
Year = m_Year
End Property
Public Property Let()Property Let Year(tmp_Year As Integer)
m_Year = tmp_Year
End Property
'--------------------
'月
Public Property Get()Property Get Month() As Integer
Month = m_Month
End Property
Public Property Let()Property Let Month(tmp_Month As Integer)
内容版权声明:除非注明,否则皆为本站原创文章。