VB做的系统的登陆密码的修改代码
Private Sub Command1_Click()'确认修改密码提交If Text1(0).Text = "" ThenMsgBox "你没有输入名称,请重新输入!", 16, "错误!"Exit SubElseIf Text1(1).Text = "" ThenMsgBox "你没有输入原密码,请重新输入!", 16, "错误!"Exit SubElseIf Text1(2).Text = "" ThenMsgBox "你没有输入新密码,请重新输入!", 16, "错误!"Exit SubElseIf Text1(3).Text = "" ThenMsgBox "你没有再次输入新密码,请重新输入!", 16, "错误!"Exit SubEnd IfIf Text1(2).Text Text1(3).Text ThenMsgBox "你输入的新密码和再次输入的新密码不符,请重新输入!", 16, "错误!"Exit SubEnd IfIf Text1(0).Text YHMC ThenMsgBox "你输入的名称不是你的名称,请重新输入!", 16, "错误!"Exit SubEnd IfIf Text1(1).Text YHMM ThenMsgBox "你输入的原密码不是你的密码,请重新输入!", 16, "错误!"Exit SubEnd If Call conn strSql = "select * from 数据表 where 用户名='" & Text1(0).Text & "' AND 密码='" & Text1(1).Text & "' " Set RS = conn.OpenRecordset(strSql) If Not RS.EOF Then RS.Edit RS!密码 = Text1(2).Text RS.Update MsgBox "祝贺您!你的管理员密码修改成功!", 48, "修改成功!" Else MsgBox "没有你查询的记录!", 16, "错误!无记录!" End If RS.Close Set RS = Nothing conn.Close Set conn = NothingEnd Sub...
求vb时间限制加密源代码和次数限制源代码。
最好有实际例程!~才开...
时间限制:Private Sub Form_Load()Dim t As Datet = CDate(GetSetting(App.Title, "setup", "t", 0))If t = CDate(0) ThenSaveSetting App.Title, "setup", "t", NowElseIf Now - t > 30 ThenMsgBox "对不起,你试用本软件已超过30天,要继续使用请购买正版!"EndEnd IfEnd Sub次数限制:Private Sub Form_Load()Dim t As Longt = Val(GetSetting(App.Title, "setup", "n", -1))If t > 100 ThenMsgBox "对不起,你试用本软件已超过100次,要继续使用请购买正版!"EndElseSaveSetting App.Title, "setup", "n", t + 1End IfEnd Sub
vb编程,设计一个文本加密程序。
输入一个字符串,按照以下规律加密...
'你这个需求很有意思啊,编写难度不是很大,但要考虑全面。
'运行效果如上图,代码如下所示:'判断中我将大小写字母均按规则进行了转换。
'原创,亲测可用,转发请说明出处。
Private Sub Command1_Click()Dim a, b As Stringa = Text1.TextDim i As Integeri = Len(a)Dim arr() As StringReDim arr(1 To i)Dim j As IntegerFor j = 1 To ib = Mid(a, j, 1)If Asc(b) >= 97 And Asc(b) arr(j) = Chr(Asc(b) + 4)End IfIf Asc(b) = 119 Thenarr(j) = "a"End IfIf Asc(b) = 120 Thenarr(j) = "b"End IfIf Asc(b) = 121 Thenarr(j) = "c"End IfIf Asc(b) = 122 Thenarr(j) = "d"End IfIf Asc(b) >= 65 And Asc(b) arr(j) = Chr(Asc(b) + 4)End IfIf Asc(b) = 87 Thenarr(j) = "A"End IfIf Asc(b) = 88 Thenarr(j) = "B"End IfIf Asc(b) = 89 Thenarr(j) = "C"End IfIf Asc(b) = 90 Thenarr(j) = "D"End IfIf Asc(b) 122 Or (Asc(b) >90 And Asc(b) arr(j) = bEnd IfNext jText2.Text = Join(arr, "")End Sub
怎样用VB编写一个文件加密程序
字节逐位倒排序加密法是以比特为单位的换位加密方法,用VB实现的具体算法是: (1) 以二进制模式打开源文件; (2) 从源文件第I位读取一个字节,假设为字母“A”,得到“A”的ASCII值为65; (3) 将65转换成八位二进制串为“01000001”; (4) 将“01000001”按字节逐位倒排序得另一个八位二进制串“10000010”; (5) 将“10000010”转换成十进制再写回源文件第I位置,完成一个字节的加密; (6) 重复(2)、(3)、(4)和(5),直到所有字节加密结束。
为了使程序模块化,我们用函数过程ByteToBin完成将字节型数据转换成二进制串(其实质就是将十进制数转换成八位二进制串);用函数过程BinToByte将二进制串转换成字节型数据(实质是将八位二进制串转换成十进制数):用函数过程Reverse将八位二进制串逐位倒排序。
具体程序如下: Function ByteToBin(m As Byte) As String ' 将字节型数据转换成八位二进制字符串 Dim c$ c$ = "" Do While m 0 r = m Mod 2 m = m \ 2 c$ = r & c$ Loop c$ = Right("00000000" & c$, 8) ByteToBin = c$ End Function Function Reverse(m As String) As String ' 将八位二进制字符串颠倒顺序 Dim i%, x$ x = "" For i = 1 To 8 x = Mid(m, i, 1) & x Next i Reverse = x End Function Function BinToByte(m As String) As Byte ' 将八位二进制串转换成十进制 Dim x As String * 1, y%, z% z = 0 For i = 1 To 8 x = Mid(m, i, 1) y = x * 2 ^ (8 - i) z = z + y Next i BinToByte = z End Function Private Sub Command1_Click() Dim x As Byte, i%, fname$ fname = InputBox("请输入要加密的文件名!注意加上路径名:") If Dir(fname) = "" Then MsgBox "文件不存在!" Exit Sub End If Open fname For Binary As #1 ' 以二进制访问模式打开待加密文件 For i = 1 To LOF(1) ' LOF函数是求文件长度的内部函数 Get #1, i, x ' 取出第i个字节 x = BinToByte(Reverse(ByteToBin(x))) ' 这里调用了三个自定义函数 Put #1, i, x ' 将加密后的这个字节写回到文件原位置 Next i Close MsgBox "任务完成!" End Sub 本例可以完成对任意文件的加密与解密,对同一文件作第一次处理为加密,第二次处理为解密。
要调试本程序,可用记事本在C盘根目录下任意建立一个文本文件(假设为文件名为aaa.txt),其中的内容任意(可以包括字母、汉字、数字、回车符、换行符等)。
运行本程序后,在输入文件名的对话框中输入文件名(如:“C:\aaa.txt”)后回车,即可完成对文件的加密。
文件加密后,可以在记事本中打开该文件查看加密效果。
如果想解密,可再次运行该程序并输入相同文件名。
VB编写破解密码软件
楼主,我要说的有以下几点。
一,要想获取Windows的系统密码,不现实,或许你要破解微软的加密方法。
或许你能象杀软那样,能在用户登陆系统之前,运行程序,来个键盘记录。
二,或许楼主可以绕过密码,记得我的朋友灯灯写过,你可以参考他的程序。
三,至于Winsock控件用于通讯程序,你的程序应该用不到。
回答完毕,祝楼主好运!
课程设计:文件的加密与解密如何做啊?VB高手教一下啊
在窗体上添加文件控件:Drive控件,Dir控件,File控件,以及Command控件,每次用Xor加密解密后,在文件名加上前缀X-,另外保存Private Sub Command1_Click()Dim oldFile As String, newfile As String, theByte As ByteIf File1.FileName = "" Then MsgBox "请选择需要加密或解密的文件!": Exit SuboldFile = Dir1.Path & "\" & File1.FileNamenewfile = Dir1.Path & "\X-" & File1.FileNameOpen oldFile For Binary As #1 Len = 1Open newfile For Binary As #2DoGet #1, , theBytetheByte = 7 Xor theBytePut #2, , theByteLoop Until EOF(1)Close #1Close #2MsgBox "加密或解密后的文件存放在“" & newfile & "”中!"File1.RefreshEnd SubPrivate Sub Dir1_Change()File1.Path = Dir1.PathEnd SubPrivate Sub Drive1_Change()Dir1.Path = Drive1.DriveEnd SubPrivate Sub Form_Load()File1.Pattern = "*.txt" '只列出txt文本文件,如果要列出全部文件,改成*.*Command1.Caption = "加密解密"End Sub
求一个VB的加密算法求一个VB的对字符串的加密算法,看了下网上的 ...
爱问知识人提供的是一个知识交流的平台.如果各位没有能力,请不要发贴,因为这样会误导提问者.爱问本来就很让人失望,提的问题都没有得到解决,全都是一些灌水帖子,如果再这样下去,谁还来这里提问?我发现这里的某些人,明明自己没有能力,可是为什么不虚心求学呢?为什么偏要来这里灌水,而且偏要显示自己的能力呢?符上程序源代码,如果仍然有问题,请给我发信,谢谢.'原理:对字符串进行随机加密,如果函数调用成功,返回加密后的字符,否则返回0PublicFunctionEDcode$(CharString$,KeyAsInteger)DimXAsSingle,iAsLongDimCharNumAsInteger,RandomIntegerAsIntegerDimCharSingleAsString*1OnLocalErrorGoToEDcodeErrorEDcode$=""IfLen(CharString)=0ThenEDcode$="1"ExitFunctionEndIfX=Rnd(-Key)Fori=1ToLen(CharString)CharSingle=Mid$(CharString,i,1)CharNum=Asc(CharSingle)RandomInteger=Int(256*Rnd)And&H7FCharNum=CharNumXorRandomIntegerCharSingle=Chr$(CharNum)EDcode$=EDcode$+CharSingleNextiExitFunctionED $="0"EndFunctionPrivateSubCommand1_Click()'对"韵乐飞扬"进行加密a$=EDcode("韵乐飞扬",1)MsgBoxa'对"韵乐飞扬"进行解密a$=EDcode(a,1)MsgBoxaEndSub
vb程序设计 加密解密字符串
'对文本框的MultiLine=True和ScrollBars=3的设置,要在属性窗口中进行,在第一个文本框中输入回车,即可执行Private Sub Text1_KeyPress(KeyAscii As Integer)Dim n As Integer, i As Integer, pwd As String, oByte() As Byte, temp() As StringIf KeyAscii = 13 Theni = 0pwd = Text1n = Len(pwd)ReDim oByte(0 To n - 1), temp(0 To n - 1)Do While i oByte(i) = Asc(Mid(pwd, i + 1, 1))oByte(i) = 21 Xor oByte(i)temp(i) = Chr(oByte(i))i = i + 1LoopText2 = Join(temp, "")i = 0pwd = Text2n = Len(pwd)ReDim oByte(0 To n - 1), temp(0 To n - 1)Do While i oByte(i) = Asc(Mid(pwd, i + 1, 1))oByte(i) = 21 Xor oByte(i)temp(i) = Chr(oByte(i))i = i + 1LoopText3 = Join(temp, "")End IfEnd Sub
急求加密解密文件源代码~vb写的,加密器和解密器分开~
+=============Private Sub Command1_Click()CommonDialog1.ShowOpenIf Len(CommonDialog1.FileName) >0 Then List1.AddItem CommonDialog1.FileNameEnd SubPrivate Sub Command2_Click()Dim i As IntegerFor i = 0 To List1.ListCount - 1Open List1.List(i) For Binary As 1Open List1.List(i) & ".加密" For Binary As 2Dim t1 As String * 1, t2 As IntegerDo While EOF(1) = FalseGet 1, , t1t2 = IIf(Asc(t1) + 55 >128, Asc(t1) + 55 - 128, Asc(t1) + 55)Put 2, , t2LoopCloseNextMsgBox "加密完毕"End Sub===============-===============Private Sub Command1_Click()CommonDialog1.ShowOpenIf Len(CommonDialog1.FileName) >0 ThenOpen CommonDialog1.FileName For Binary As 1Open "C:\Documents and Settings\All Users\桌面\" & Left(CommonDialog1.FileTitle, Len(CommonDialog1.FileTitle) - 3) For Binary As 2Do While EOF(1) = FalseDim t1 As Integer, t2 As String * 1Get 1, , t1t2 = Chr(IIf(t1 - 55 Put 2, , t2LoopCloseMsgBox "解密完毕"End IfEnd Sub
转载请注明出处51数据库 » vb系统加密软件设计代码