- Home
·
- Miscellaneous
·
- The application checks the allocated logon time of the user at regular interval and automatically l
The application checks the allocated logon time of the user at regular interval and automatically l
The application checks the allocated logon time of the user at regular interval and automatically logoff the user account.
Rate The application checks the allocated logon time of the user at regular interval and automatically l
(1(1 Vote))
Dim no As Variant, userinfo As Variant
Dim start As Byte
Dim user As String, username As String
Dim st As Date, et As Date, ct As Date
Private Sub Form_Load()
start = 0
Set no = CreateObject("WScript.Network")
Open "c:\winnt\system32\repl\import\scripts\user.txt" For Input As #1
End Sub
Private Sub Timer1_Timer()
If start = 0 Then
Dim result As Long
Dim textline As String
user = no.username
ct = Format(Time, "hh:mm AM/PM")
username = ""
Do While user <> username
Line Input #1, textline
username = Mid(textline, 1, InStr(textline, ",") - 1)
Loop
userinfo = Split(textline, ",")
st = userinfo(1)
et = userinfo(2)
Set no = Nothing
Close #1
start = 1
End If
If ct < st Or ct > et Then
result = ExitWindowsEx(EX_WIN, 0&)
End If
End Sub
' file format
' user1,10:00 AM,12:00 PM
' user2,12:00 PM,01:00 PM
The application checks the allocated logon time of the user at regular interval and automatically l Comments
No comments yet — be the first to post one!
Post a Comment