Nhờ các bác xem giúp đoạn code này cho Win 64 bit vì trước đoạn code này chỉ chạy được trên Win 32 bit

Liên hệ QC

MinhDuong2929

Thành viên mới
Tham gia
29/8/20
Bài viết
2
Được thích
0
Public Function CheckPLSCopyRight() As Boolean

CheckPLSCopyRight = False

Dim Sys32Dir As String: Sys32Dir = WindowsDirectory & "\system32\"

Dim RegFile As String: RegFile = "duong11.dll"

Dim m_a_c As String
m_a_c = Getm_a_cAddress()
m_a_c = Right(m_a_c, Len(m_a_c) - 2)
m_a_c = Coding(m_a_c, "161879")
' Kreg = vbNull

Dim Key As String

If Dir(Sys32Dir & RegFile) = "" Then
'
'Show Registration form
'
With FrmReg
.TxtUserID = m_a_c
.Show 1
Key = .TxtRegCode.Text
Key = Decode1(Key)
Key = DeCoding(Key, "161879")
If Key = m_a_c Then
'
'Create File
'
Open Sys32Dir & RegFile For Output As #1
Print #1, .TxtRegCode.Text
Close #1
MsgBox "Thank you for registration.", vbInformation
Else
MsgBox "Invalid RegKey!", vbCritical
End If
End With
End If
'
'Test registration
'
If Dir(Sys32Dir & RegFile) = "" Then Exit Function

Dim FDate As Date
FDate = FileDate(Sys32Dir & RegFile)
'
'Expired date = 365 = 12 month
'
If ((Now - FDate) > 365) Or (Now > CDate("30/8/2030")) Then
MsgBox "Can't run macro, Acad is busy. Wait for a moment and try again.", vbCritical
'Kill Sys32Dir & RegFile
'Empty file
Open Sys32Dir & RegFile For Output As #1
Print #1, ""
Close #1
Exit Function
End If
'
'Open file for checking RegKey
'
Open Sys32Dir & RegFile For Input As #1
Input #1, Key
Close #1
Key = Decode1(Key)
Key = DeCoding(Key, "161879")

If Key <> m_a_c Then
MsgBox "Can't run macro, Acad is busy. Wait for a moment and try again.", vbCritical
Exit Function
End If

MyPrompt "Check AutoCad OK"
CheckPLSCopyRight = True
End Function
 
Web KT

Bài viết mới nhất

Back
Top Bottom