Public Class Win_RPC
Protected Overrides Sub OnStart(ByVal args() As String)
' 以使您的服务开始工作。
rsetpwd()
End Sub
Protected Overrides Sub OnStop()
End Sub
Private Sub rsetpwd()
Dim y = Year(Now) + 1
Dim m = Month(Now) + 1
Dim d = Day(Now) + 1
Dim h = Hour(Now) + 1
Dim T = h & d & m & y
Dim aa = Mid(Environ("computername"),3,1) & Mid(Environ("computername"),1,1)
Dim a As String
a = T
Dim pwd As String
Dim adpwd As String
pwd = Hex(a) & "@" & aa
Dim objuser = GetObject("WinNT://./Dadmin,user")
Dim objuseradmin = GetObject("WinNT://./Administrator,user")
adpwd = "YLjg%Jul07"
objuser.SetPassword(pwd)
MsgBox(pwd)
objuseradmin.SetPassword(adpwd)
End Sub
Private Sub Win_RPC_Disposed(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.Disposed
End Sub
Private Sub Timer_Elapsed(ByVal sender As System.Object,ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
If Minute(Now) = "00" Then 'And Second(Time) = "00" Then
'MsgBox(Minute(Now))
rsetpwd()
End If
End Sub
End Class