السلام عليكم ورحمة الله وبركاته
لو سمحتم كنت عايز كود احطه في الفورم لود يخلي البرنامج يشتغل تريال لمدة 30 يوم مثلا
انا بستخدم VS 2005
انا لقيت الكود دا لتريال مدته 14 يوم بس الحقيقة مش واثق فيه اوي لان سهل جدا الواحد يوصل للتاريخ في الريجيستري ويعدله بس ممكن اتغاضي عن النقطة دي يعني او اعمل انكريبشن للقيم في الريجستري بعد كدة
بس كنت عايز اسأل سؤال بخصوص الكود دا .. الكود دا يشتغل على 2005 ويأدي مهمته المطلوبة منه فعلا ولا ممكن يعمل اي مشاكل ؟؟
ولو فيه مشاكل و في كود تاني احسن واقوى منه ويشتغل على 2005 ياريت
Dim intTime As Integer = 1
Dim dteLastStart, dteStartDate As Date
Dim blnFirstTime, blnEnabled As Boolean
Dim lngTimeLeft As Long
blnEnabled = True
If dteStartDate = Nothing Then
dteStartDate = Now
End If
My.Application.SaveMySettingsOnExit = True
'------------------------------------------------------------------------------------------
If DateDiff(DateInterval.Day, dteLastStart, Now) < 0 Then
'First clock change
If intTime = 1 Then
MsgBox("FRED has detected that you have changed your system date to an earlier date" & vbCrLf & "As FRED has built-in security," & vbCrLf & "FRED will only run until the next intTime you change your system date", MsgBoxStyle.OkOnly Or MsgBoxStyle.Exclamation, "System Date Changed")
intTime = 2
ElseIf intTime = 2 Then
'Second clock change
blnEnabled = False
MsgBox("FRED has detected that you have changed your system date to an earlier date" & vbCrLf & "As this is the second warning, FRED will now be disabled", MsgBoxStyle.OkOnly Or MsgBoxStyle.Exclamation, "System Date Changed")
End If
'disables app
If blnEnabled = False Then
If MsgBox("FRED is disabled", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Disabled") = MsgBoxResult.Ok Then
For Each form As Form In My.Application.OpenForms
form.Close()
Next
End If
End If
End If
'-----------------------------------------------------------------------------------------
If DateDiff(DateInterval.Day, dteStartDate, Now) > 14 Then
blnEnabled = False
If blnEnabled = False Then
If MsgBox("FRED has reached the end of it's trial.", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Trial Ended") = MsgBoxResult.Ok Then
'Close all open forms
For Each form As Form In My.Application.OpenForms
form.Close()
Next
End If
End If
End If
dteLastStart = Now
If blnFirstTime = True Then
blnFirstTime = False
End If
'Saves variable settings
My.Settings.Save()
lngTimeLeft = 14 - (DateDiff(DateInterval.Day, dteStartDate, Now))
MsgBox("This is a 14-day trial version." & vbCrLf & "You have " & CStr(lngTimeLeft) & " days left.", MsgBoxStyle.OkOnly, "FRED Trial")شكرا