13-12-15, 08:49 PM
PHP كود :
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If CheckTrialPeriod(Application.StartupPath, 30) Then
MessageBox.Show("you are in trial period ", "Information")
Me.Close()
End If
End Sub
Private Function CheckTrialPeriod(projectDirectory As String, tryPeriod As Integer) As Boolean
Try
Dim dt As DateTime = System.IO.Directory.GetCreationTime(projectDirectory)
If DateTime.Now.Subtract(dt).TotalDays > tryPEriod Then
Return True
End If
Catch ex As Exception
Return False
End Try
Return False
End Function

