欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【用ASP+DLL实现WEB方式修改服务器时间】,下面是详细的分享!
用ASP+DLL实现WEB方式修改服务器时间
1
Option Explicit2
Private SystemTime As SystemTime3

Private Declare Function SetSystemTime()Function SetSystemTime Lib "kernel32" (lpSystemTime As SystemTime) As Long4
Private Type SystemTime5
wYear As Integer6
wMonth As Integer7
wDayOfWeek As Integer8
wDay As Integer9
wHour As Integer10
wMinute As Integer11
wSecond As Integer12
wMilliseconds As Integer13
End Type14

15
Dim tmp16

17
Private m_Hour As Integer18
Private m_Minute As Integer19
Private m_Year As Integer20
Private m_Month As Integer21
Private m_Day As Integer22
Private m_Second As Integer23

24
'由李锡远修改 修改日期:2006-08-31 修改项目:增加对年、月、日、秒的操作25
'--------------------26
'年27

Public Property Get()Property Get Year() As Integer28
Year = m_Year29
End Property30

Public Property Let()Property Let Year(tmp_Year As Integer)31
m_Year = tmp_Year32
End Property33
'--------------------34
'月35

Public Property Get()Property Get Month() As Integer36
Month = m_Month37
End Property38

Public Property Let()Property Let Month(tmp_Month As Integer)39
m_Month = tmp_Month40
End Property41
'--------------------42
'日43

Public Property Get()Property Get Day() As Integer44
Day = m_Day45
End Property46

Public Property Let()Property Let Day(tmp_Day As Integer)47
m_Day = tmp_Day48
End Property49
'--------------------50
'秒51

Public Property Get()Property Get Second() As Integer52
Second = m_Second53
End Property54

Public Property Let()Property Let Second(tmp_Second As Integer)55
m_Second = tmp_Second56
End Property57

58

59

60

Public Property Get()Property Get Hour() As Integer61
Hour = m_Hour62
End Property63

Public Property Let()Property Let Hour(tmp_Hour As Integer)64
m_Hour = tmp_Hour65
End Property66

Public Property Get()Property Get Minute() As Integer67
Minute = m_Minute68
End Property69

Public Property Let()Property Let Minute(tmp_Minute As Integer)70
m_Minute = tmp_Minute71
End Property72

73

74

75

76

Public Function setup()Function setup() As Integer77
SystemTime.wDay = Day78
'SystemTime.wDayOfWeek = 179
SystemTime.wMilliseconds = 080
SystemTime.wMonth = Month81
SystemTime.wSecond = Second82
SystemTime.wYear = Year83
SystemTime.wHour = Hour84
SystemTime.wMinute = Minute85
setup = SetSystemTime(SystemTime)86

87
End Function88

关于DLL的注册,通常VB在本机上编译后,会自动将DLL注册;但如果你要放到IIS服务器上,请使用如下方法:
1、将systimeset.dll拷贝到c:\WINDOWS\system32下;
2、在开始菜单的运行里面输入:regsvr32 systimeset.dll (敲回车啊)
3、因为修改服务器的时间,INTERNET来宾帐户不具有该权限,设立权限请打开控制面版中的“管理工具”,然后打开“本地安全策略”--“用户权力指派”,双击“更改系统时间”,在弹出的对话框中点“添加用户或组”,将INETNET来宾帐户加入进来。
4、一切完毕后,将IIS服务重新启动一次。
在上面的设置完毕后,使用systimeset.dll组件的ASP代码页面如下:
以上所分享的是关于用ASP+DLL实现WEB方式修改服务器时间,下面是编辑为你推荐的有价值的用户互动:
相关问题:用asp.net web写一个实现时间日期的程序。例如今天...
答:您好,如下,请参考 static void Main(string[] args) { DateTime now = DateTime.Now; string year = now.ToString("yyyy年MM月dd日"); int n = (int)now.DayOfWeek; string[] weekDays = { "星期天", "星期一", "星期二", "星期三", "星期四",... >>详细
相关问题:设置自定义ASP.NET服务器控件TagPrefix的几种方法...
答:1usingSystem;2usingSystem.Collections.Generic;3usingSystem.ComponentModel;4usingSystem.Text;5usingSystem.Web;6usingSystem.Web.UI;7usingSystem.Web.UI.WebControls;89namespaceServerControl10{11[ToolboxData(" >>详细
相关问题:asp.net问题 怎么在web.config里设置时间点并在其...
答:在 web.config 的 appSettings 小节里,添加 在你的隐藏按钮的页面里,判断: DateTime startDate = DateTime.Parse(WebConfigurationManager.AppSettings["startDate"]); DateTime endDate = DateTime.Parse(WebConfigurationManager.AppSettin... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
