Donde puedo conseguir una rutina de tiempo para que pasado tres meses o dias se bloquee el programa y saque un mesagebox diciendo lo que sea ?
gracias
Luis
Cita de: luis456 en 14 Noviembre 2013, 06:57 AMDonde puedo conseguir una rutina de tiempo para que...
Librería de Snippets (http://foro.elhacker.net/net/libreria_de_snippets_posteen_aqui_sus_snippets-t378770.0.html)
(descarga el zip y busca por Trial)
Cita de: EleKtro H@cker en 14 Noviembre 2013, 08:41 AM
Librería de Snippets (http://foro.elhacker.net/net/libreria_de_snippets_posteen_aqui_sus_snippets-t378770.0.html)
(descarga el zip y busca por Trial)
Gracias Elektro :)
por cierto te llego mi privado ?
Luis
Cita de: luis456 en 14 Noviembre 2013, 13:24 PM
por cierto te llego mi privado ?
Hola
si, ya lo he visto no te preocupes, en cuanto pueda le daré prioridad a eso y te comento algo.
un saludo!
Bueno gracias Elektro pero busco algo como esto ,este codigo que encontre no se como haria para usarlo
'Comprueba si ha expirado el trial
If UlFicha > 100 Then
Call TrialExpirado
Exit Sub
End If
Public Sub TrialExpirado()
Call MsgBox("La versión Trial a expirado. Póngase en contacto su distribuidor", vbCritical, "TRIAL EXPIRADO")
End Sub
Gracias
Luis
Ese código (incompleto) es muy vb6 (como todo lo que sueles mostrar hasta ahora), sería mucho mejor que intentes hacerlo por ti mismo usando el estilo .NET, que usar códigos como ese.
Lo mejor es usar un programa que añada el sistema de expiración profesional, pero bueno, toma un ejemplo de una expiración muy sencilla:
' [Trial Expiration]
'
' By Elektro H@cker
#Region " Easy Trial Expiration "
Public Class TrialExpiration
#Region " Variables "
''' <summary>
''' The date that the expiration started.
''' </summary>
Public Property TrialDateStart As New Date(Nothing)
''' <summary>
''' The date that the expiration ends.
''' </summary>
Public Property TrialDateEnd As New Date(Nothing)
''' <summary>
''' Expiration days.
''' </summary>
Public Property TrialDays As Integer = 0
''' <summary>
''' Expiration days left.
''' </summary>
Public Property DaysLeft As Integer = 0
''' <summary>
''' Indicates wether the expiration has expired.
''' </summary>
Public Property IsExpired As Boolean = False
''' <summary>
''' Indicates the application compiled executable name to avoid the user renaming the file.
''' </summary>
Private EXEname As String = String.Empty
#End Region
#Region " Constructor "
''' <summary>
''' Creates a new Trial Expiration.
''' </summary>
''' <param name="EXEname">
''' The application compiled executable name.
''' This way if the compiled executable name is manipulated by the user, an expired case will be trhown.
''' </param>
''' <param name="TrialDays">
''' Amount of days to expire.
''' </param>
Public Sub New(ByVal EXEname As String, ByVal TrialDays As Integer)
EXEname = EXEname
Me.TrialDays = TrialDays
SetTrialDates()
GetDaysLeft()
End Sub
#End Region
#Region " Public Methods "
''' <summary>
''' Resets the Trial Expiration.
''' </summary>
Public Sub Reset()
My.Settings.TrialDate = String.Empty
My.Settings.Save()
' My.Settings.Reload()
End Sub
#End Region
#Region " Private Methods "
Private Sub SetTrialDates()
' If it's application first time run then set the initial date as Today.
If String.IsNullOrEmpty(My.Settings.TrialDate) Then
My.Settings.TrialDate = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(Today.ToString))
My.Settings.Save()
My.Settings.Reload()
End If
Try
TrialDateStart = Date.Parse(System.Text.Encoding.ASCII.GetString(Convert.FromBase64String(My.Settings.TrialDate)))
Catch ex As FormatException
' Exception thrown if the user has corrupted the base64 string from the settings file.
' Then truncates the initial date to force trial expiration.
TrialDateStart = Date.Parse("0001/01/01")
End Try
TrialDateEnd = TrialDateStart.AddDays(Me.TrialDays)
End Sub
Private Sub GetDaysLeft()
Me.DaysLeft = (DateTime.Now.Subtract(Today) - DateTime.Now.Subtract(TrialDateEnd)).Days
Me.IsExpired = (Me.DaysLeft <= 0 _
OrElse Today < TrialDateStart _
OrElse Not String.Compare(Process.GetCurrentProcess().MainModule.ModuleName, EXEname, True) = 0)
' "OrElse Today < TrialDateStart" explanation:
' If the user has manipulated te Windows OS date.
' OrElse Process.GetCurrentProcess().MainModule.ModuleName <> EXEname
End Sub
#End Region
End Class
#End Region
Public Class Form1
Private WithEvents _Trial As New TrialExpiration("WindowsApplication1.exe", 7)
Private Shadows Sub Shown() Handles MyBase.Shown
' _Trial.Reset()
Select Case _Trial.IsExpired
Case True
MsgBox(String.Format("Your copy of this software has expired on {0}.",
_Trial.TrialDateEnd.ToString))
Case False
MsgBox(String.Format("You have {0} expiration remaining days.",
CStr(_Trial.DaysLeft)))
End Select
End Sub
End Class
Debes añadir una nueva setting llamada "TrialDate" de tipo String y de scope "User".
Saludos.