|
Sub 授权使用(ByRef flag As Integer)
Dim Usernames(100) As String
Dim Computernames(100) As String
Dim username1 As String
Dim computername1 As String
Dim i, regFlag As Integer
Dim PresentDay, LastDate As Long
Dim theNum1, theNum2 As Integer
Dim Hidename As String
Hidename = "000O0000O00000OOOOOOOOO00OOOOOO"
Usernames(1) = "P121060"
Usernames(2) = "P148183"
Usernames(3) = "P145018"
Usernames(4) = "P145020"
Usernames(5) = "P145021"
Usernames(6) = "P136382"
Usernames(7) = "P136450"
Usernames(8) = "P136458"
Usernames(9) = "P136642"
Usernames(10) = "P136662"
Usernames(11) = "P129162"
Usernames(12) = "P129175"
Usernames(13) = "P129196"
Usernames(14) = "P129198"
Usernames(15) = "P120746"
Usernames(16) = "P120856"
Usernames(17) = "P120862"
Usernames(18) = "P120955"
Usernames(19) = "P120824"
Usernames(20) = "P121031"
Usernames(21) = "P121032"
Usernames(22) = "P121033"
Usernames(23) = "P120828"
Usernames(24) = "P120937"
Usernames(25) = "P120938"
Usernames(26) = "P120717"
Usernames(27) = "P120718"
Usernames(28) = "P208430"
Usernames(29) = "P208449"
Usernames(30) = "P208646"
Usernames(31) = "P208445"
Usernames(32) = "P208652"
Usernames(33) = "P153868"
Usernames(34) = "P153864"
Usernames(35) = "P153862"
Usernames(36) = "P153867"
Usernames(37) = "P153863"
Usernames(38) = "P153866"
Usernames(39) = "P153869"
Usernames(40) = "P153870"
Usernames(41) = "P153940"
Usernames(42) = "Administrator; "
Usernames(43) = "Administrator"
username1 = UCase(VBA.Environ("username"))
computername1 = UCase(VBA.Environ("computername"))
flag = 0
i = 1
Do While i < 100
If username1 = Usernames(i) Then
flag = 1
Exit Do
End If
i = i + 1
Loop
If flag = 1 Then
regFlag = GetSetting("Superwid", "identity", "regFlag", 2)
If regFlag = 2 Then
SaveSetting "Superwid", "identity", "regFlag", 1
End If
End If
If flag = 0 Then
SaveSetting "Superwid", "identity", "regFlag", 0
End If
PresentDay = Date
If PresentDay >= 41913 Then
flag = 0
SaveSetting "Superwid", "identity", "regFlag", 0
Sheets(Hidename).Visible = xlSheetVisible
Sheets(Hidename).Select
Range("IP3687").Value = 0
Sheets(Hidename).Visible = xlSheetVeryHidden
End If
Sheets(Hidename).Visible = xlSheetVisible
Sheets(Hidename).Select
theNum1 = Range("IP3687").Value
Range("IP23687").Value = Range("IP23687").Value + 1
theNum2 = Range("IP23687").Value
LastDate = Range("BS12345").Value
Range("BS12345").Value = Date
Sheets(Hidename).Visible = xlSheetVeryHidden
If theNum1 = 0 Then
flag = 0
SaveSetting "Superwid", "identity", "regFlag", 0
End If
If theNum2 > 2500 Then
flag = 0
SaveSetting "Superwid", "identity", "regFlag", 0
End If
If PresentDay < LastDate Then
flag = 0
SaveSetting "Superwid", "identity", "regFlag", 0
Sheets(Hidename).Visible = xlSheetVisible
Sheets(Hidename).Select
Range("BS12345").Value = LastDate
Sheets(Hidename).Visible = xlSheetVeryHidden
End If
regFlag = GetSetting("Superwid", "identity", "regFlag", 2)
If regFlag = 0 Then
flag = 0
End If
If username1 = "P121060" Then
flag = 1
End If
End Sub
这段程序明明是限制授权人的,我知道能看懂上面,但是到了下面我就看不懂了,而且我把我的用户名添加到上面的用户列表中也没有用,请各位大神帮我看看……
该贴已经同步到 78舵主87的微博 |
|