كود جميل جدا لجعل برنامجك لفترة تجريبية لمدة 15 يوما
صفحة 1 من اصل 1 • شاطر
كود جميل جدا لجعل برنامجك لفترة تجريبية لمدة 15 يوما
بسم الله الرحمن
الكثير منا يود أن يجعل برنامجة تجريبى لفترة معينة لذلك أحضرت لكم كود يقوم بتلك العملية وهو على النحو التالى :
الكثير منا يود أن يجعل برنامجة تجريبى لفترة معينة لذلك أحضرت لكم كود يقوم بتلك العملية وهو على النحو التالى :
- الكود:
Private str As String
Private str1 As String
Private str2 As String
Private initialDate As Date
Private expDate As Date
Private usedDate As Date
Private Expire As Boolean
Sub Main()
Call Expire_Project
End Sub
Public Sub Expire_Project()
str = GetSetting("Project Name", "Expiry", "Initial Date")
'First Get the Value from the Registry
If Len(Trim(str)) < 1 Then
'If the Registry Value is not set then Set the Value
SaveSetting "Project Name", "Expiry", "Initial Date", Date
expDate = DateAdd("d", 15, Date)
'Add 15 days to the Current Date
SaveSetting "Project Name", "Expiry", "Expiry Date", expDate
'Here I have Given 15 days for expiration of the Software You can Give 'n' no of days as you like
Else
str1 = GetSetting("Project Name", "Expiry", "Used Date")
'If this Registry Value is not Set then
If Len(Trim(str1)) < 1 Then
str = GetSetting("Project Name", "Expiry", "Initial Date")
'Get the Previously set Initial Value from the Registry
initialDate = CDate(str)
str2 = GetSetting("Project Name", "Expiry", "Expiry Date")
'Get the Expiry Value from the Registry
expDate = CDate(str2)
If Date > expDate Or Date < initialDate Then
'Compare Registry Values with the Date, if they are bound with in the Initial Value of the Software and Expiry Value of the SOftware then only the Program will run
SaveSetting "Project Name", "Expiry", "Used Date", "True" 'Now set the Used Date value to True
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
Else
MsgBox "Software Has Been Expired; You cannot run the Software by Setting the Date Backwards", vbExclamation, "Software Expired"
Expire = True
Exit Sub
End If
End If
End Sub
المبرمج الطموح- الاشراف
- تاريخ التسجيل : 18/02/2011
المساهمات : 207
النقاط : 368
التقيم : 17
الدولة :
الجنس :
| |
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى
أمس في 8:56 pm من طرف moslema_r
» شركة مكافحة حشرات في راس الخيمة
أمس في 8:34 pm من طرف moslema_r
» تطبيقIncogniton لإدارة ملفات تعريف متعددة للمتصفح
الأربعاء أبريل 24, 2024 3:51 pm من طرف زاكااا
» افضل شركة مكافحة النمل الابيض بالرياض
الإثنين أبريل 22, 2024 9:41 pm من طرف moslema_r
» Exemplary Сasual Dating - Verified Women
الخميس أبريل 18, 2024 9:18 pm من طرف wdqwd
» رش الدفان بالرياض
الخميس أبريل 18, 2024 7:11 pm من طرف moslema_r
» شركة تنظيف خزانات الشارقة
الخميس أبريل 18, 2024 6:57 pm من طرف moslema_r
» شركة مكافحة الفئران بالرياض
الإثنين أبريل 15, 2024 8:23 pm من طرف moslema_r
» افضل شركة كشف تسربات المياه بالباحة
الخميس أبريل 04, 2024 7:02 am من طرف gmalnagy
» ساعدوني وفهموني help me
الجمعة مارس 29, 2024 8:37 am من طرف linesoft