金币
威望
UID5899
回帖0
主题
积分248
注册时间2011-4-20
最后登录1970-1-1
在线时间 小时
性别保密
|
发表于 2013-5-16 00:47:57
|
显示全部楼层
本帖最后由 k2201 于 2013-5-16 00:49 编辑
灵山大X 发表于 2013-5-15 22:25 ![](http://www.0777tt.cn/static/image/common/back.gif)
灵山有搞程序的?第一次听说如果你在灵山属于中上水平了。
'------------------------
'作 者:k2201
'版权:lfit
Private conn As New ADODB.Connection
Private Sub adminlogin()
Static j As Integer
Dim rs As New ADODB.Recordset
sql = "select 帐号,密码 from admin Where 帐号 ='" & text1.Text & "' and 密码 ='" & text2.Text & "'"
Set rs = conn.Execute(sql)
If rs.EOF And rs.BOF Then
j = j + 1
rs.Close
Set rs = Nothing
MsgBox "密码错误"
If j > 1 Then
MsgBox "连续错误3次!程序将退出"
End
End If
Else
hone1.Show
Unload Me
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()’加载窗口时自动运行代码
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data\Admin.mdb;Mode=ReadWrite|Share Deny Noneersist Security Info=False" + ";Jet OLEDBatabase Password=041127"
Text4.Text = GetSetting("lfit", "lfApp", "key")
If Text3.Text <> Text4.Text Then
Dim nStr As String, S As Long
nStr = GetSetting("lfit", "lfApp", "Times", "") '从注册表读取已使用次数
S = Val(nStr)
ZC.Text4.Text = S '显示使用次数,
If S > 15 Then
MsgBox "软件试用次数已到,请联系k2201买注册码!", vbInformation
Unload ling
ZC.Show
Exit Sub
End If
SaveSetting "lfit", "lfApp", "Times", S + 1 '使用次数加1,保存到注册表
End If
End Sub
Private Sub cmd_Click()
Call adminlogin
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set conn = Nothing
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call adminlogin
End Sub
------------------------------------------------------------------------------
有家有计,不想出外地拼博啦,我是在灵山工作,以上是简单的landed 代码,如果有看得懂的PM我吧.
|
|