【VB开源代码栏目提醒】:网学会员VB开源代码为您提供frm_znsb.frm参考,解决您在frm_znsb.frm学习中工作中的难题,参考学习。
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_znsb
BorderStyle = 3 'Fixed Dialog
Caption = "采购管理系统(试用版智能监测程序)"
ClientHeight = 2250
ClientLeft = 45
ClientTop = 330
ClientWidth = 4200
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2250
ScaleWidth = 4200
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "隐藏"
Height = 300
Left = 3240
TabIndex = 12
Top = 1960
Width = 855
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 11
Top = 4320
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 10
Top = 3840
Width = 2055
End
Begin VB.TextBox Txt_temp1
Height = 375
Left = 1920
TabIndex = 9
Top = 3240
Width = 2055
End
Begin VB.Frame Frame1
Caption = "当前版本信息"
ForeColor = &H000000C0&
Height = 1815
Left = 120
TabIndex = 0
Top = 120
Width = 3975
Begin MSComCtl2.DTPicker DT_sc
Height = 300
Left = 1320
TabIndex = 7
Top = 240
Width = 2535
_ExtentX = 4471
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 29949953
CurrentDate = 38271
End
Begin MSComCtl2.DTPicker DT2
Height = 300
Left = 1320
TabIndex = 5
Top = 960
Width = 2535
_ExtentX = 4471
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 29949953
CurrentDate = 38271
End
Begin MSComCtl2.DTPicker DT1
Height = 300
Left = 1320
TabIndex = 3
Top = 600
Width = 2535
_ExtentX = 4471
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 29949953
CurrentDate = 38271
End
Begin VB.Label Label5
BackColor = &H00FF8080&
ForeColor = &H00000080&
Height = 255
Left = 120
TabIndex = 6
Top = 1440
Width = 3735
End
Begin VB.Label Label4
Caption = "软件到期时间"
Height = 255
Left = 120
TabIndex = 4
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "系统当前日期"
Height = 375
Left = 120
TabIndex = 2
Top = 720
Width = 1335
End
Begin VB.Label Label1
Caption = "首次安装日期"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 1335
End
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "本软件的试用期限为 30 天"
Height = 255
Left = 840
TabIndex = 8
Top = 2040
Width = 2295
End
End
Attribute VB_Name = "frm_znsb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_COLSE = &HF060
Private Const SC_MAXIMIZE = &HF030
Private Const SC_MINIMIZE = &HF020
Private Sub Command1_Click()
frm_znsb.Hide
End Sub
Private Sub Form_Load()
Dim Intext, Intext1, Intext2, Intext3 As String
Dim temp, temp_sj As String
DT1.Value = Date
Open (App.Path & "\首次安装.txt") For Input As #1
Do While Not EOF(1)
Line Input #1, Intext
Txt_temp1 = Intext
Loop
Close #1
If Txt_temp1 = "" Then '如果等于空则证明是首次安装
DT1.Value = Date
DT_sc.Value = Date
DT2.Value = DateAdd("d", 30, DT_sc)
Open (App.Path & "\首次安装.txt") For Output As #1
Print #1, DT_sc.Value
Close #1
Open (App.Path & "\软件到期时间.txt") For Output As #1
Print #1, DT2.Value
Close #1
temp_sj = Str(DateDiff("d", DT1.Value, DT2.Value))
Open (App.Path & "\软件使用天数.txt") For Output As #1
Print #1, temp_sj
Close #1
Label5.Caption = "对于本软件 您还可以使用 " + Str(DateDiff("d", DT1.Value, DT2.Value)) + " 天"
frm_znsb.Hide
frm_czydl.Show
Else
Open (App.Path & "\首次安装.txt") For Input As #1
Do While Not EOF(1)
Line Input #1, Intext
DT_sc.Value = Intext
Loop
Open (App.Path & "\软件到期时间.txt") For Input As #2
Do While Not EOF(2)
Line Input #2, Intext2
DT2.Value = Intext2
Loop
Close #2
Label5.Caption = "对于本软件 您还可以使用 " + Str(DateDiff("d", DT1.Value, DT2.Value)) + " 天"
Text2.Text = Str(DateDiff("d", DT1.Value, DT2.Value)) '天数
Open (App.Path & "\软件使用天数(临时).txt") For Output As #4
Print #4, Text2.Text '将天数存入临时天数记事本文件当中
Close #4
Open (App.Path & "\软件使用天数.txt") For Input As #5
Do While Not EOF(5)
Line Input #5, Intext3
Text1.Text = Intext3
Loop
Close #5
If Val(Trim(Text2.Text)) > Val(Trim(Text1.Text)) Then
MsgBox " 尊敬的用户,您好!请您不要通过修改系统时间来延长本软件的试用期时间,您这样做是徒劳的,您只具有试用30天的权限,如果您已经修改了系统的时间,请将系统时间改为当天的真正日期,否则系统将无法再运行!!"
End
ElseIf Val(Trim(Text2.Text)) <= 0 Then
MsgBox "对不起!您对使用本软件试用期限已到,请您退出系统"
End
Else
Text2.Text = Str(DateDiff("d", DT1.Value, DT2.Value))
Open (App.Path & "\软件使用天数.txt") For Output As #6
Print #6, Text2.Text
Close #6
frm_znsb.Hide
frm_czydl.Show
End If
End If
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
RemoveMenu GetSystemMenu(frm_znsb.hwnd, 0), SC_COLSE, MF_REMOVE '关闭按钮不可用
End Sub
Private Sub RichText3_Change()
End Sub
上一篇:
frm_zffs.frm
下一篇:
法律专业开题报告范文