Bonjour
J'aimerais savoir s'il est possible a l'intérieur d'un vbs/hta appliquer une quelconque manipulation/date de sorte que le hta en lui même ne soit plus utilisable après cette date?
merci pour l'info
Version imprimable
Bonjour
J'aimerais savoir s'il est possible a l'intérieur d'un vbs/hta appliquer une quelconque manipulation/date de sorte que le hta en lui même ne soit plus utilisable après cette date?
merci pour l'info
Bonjour,
Une boucle en début de programme.
Code:
1
2
3
4
5
6
7 Expiration = Cdate("12/03/2013") DateSysteme = Date If (DateSysteme < Expiration) Then Programme Else Wscript.Quit End If
Merci Miistik
fonctionne parfaitement...
j'ai modifié la dernière section
Code:
1
2
3
4 Else MsgBox ("Fin de la période d'essai.") window.close() End If
:salut:
une petite tentative en HTA avec un message clignotant :mouarf:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86 <html> <head> <TITLE>Expiration_Date</TITLE> <HTA:APPLICATION APPLICATIONNAME="Expiration_Date" VERSION="1.0.0.0" BORDER="none" INNERBORDER="no" CAPTION="no" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" ICON="NO" SCROLL="no" SCROLLFLAT="yes" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SHOWINTASKBAR="no" CONTEXTMENU="Yes" SYSMENU="Yes" SELECTION="no"/> <SCRIPT Language="VBScript"> SEC="0" MIN="0" HRS="0" Sub CenterWindow(x,y) window.resizeTo x, y iLeft = window.screen.availWidth/2 - x/2 itop = window.screen.availHeight/2 - y/2 window.moveTo ileft, itop End Sub Sub Window_onLoad CenterWindow 500,200 Expiration_Date() End Sub Sub Expiration_Date() Expiration = Cdate("12/01/2013") DateSysteme = Date If (DateSysteme < Expiration) Then MsgBox "Le Programme est encore valide !",64,"Le Programme est encore valide !" Else IdTimer=Window.SetInterval("blink(bl)",500) Call Timer End If End Sub SUB TIMER() IF SEC<>"59" THEN SEC=SEC+1 If SEC = "10" Then Window.Close ELSE SEC="0" IF MIN<>"59" THEN MIN=MIN+1 ELSE MIN="0" HRS=HRS+1 END IF END IF IF LEN(SEC)="1" THEN SEC="0"&SEC IF LEN(MIN)="1" THEN MIN="0"&MIN IF LEN(HRS)="1" THEN HRS="0"&HRS temps.InnerHTML="<TEXT>"&HRS&":"&MIN&":"&SEC&"</TEXT>" Window.ClearTimeOut(IdTimer) IdTimer=Window.SetTimeOut("TIMER()",1000,"VBScript") END SUB Function blink(Obj) if Obj.style.visibility = "visible" Then Obj.style.visibility = "hidden" else Obj.style.visibility = "visible" end if End Function </script> </head> <BODY BGCOLOR="#000000" TOPMARGIN="0" LEFTMARGIN="0"> <center><TABLE WIDTH="200" BORDER="1" BORDERCOLOR="#000000" BGCOLOR="#BBBBFF" CELLPADDING="2" CELLSPACING="1"> <TR BGCOLOR="#346E99"><TD COLSPAN="2"><CENTER><FONT COLOR="#FFFFFF" SIZE="+1" FACE="VERDANA,ARIAL,HELVETICA,SANS-SERIF">-= T I M E R =-</FONT></CENTER></TD></TR> <TR><TD WIDTH="150"><center><TEXT>Temps Restant</TEXT></center></TD><TD WIDTH="150"><center><SPAN ID=temps></SPAN></center></TD></TR></TABLE> <br><br> <div id="bl" style="visibility:hidden"><font size=+2 color=red><center>ATTENTION le programme vient d'être expiré !!!</center></font></div> </script> </body> </html>