- UID
- 13801
注册时间2006-5-22
阅读权限40
最后登录1970-1-1
独步武林
该用户从未签到
|
感到使用VB等语言的兄弟调用这些现成的算法比较麻烦,特写个DLL,给大家调用,呵呵。。。。。。。。。
MIME也就是BASE64,其它的就不多说了。。。。。。。。
下面的源码是VB.NET写的,把其中的源码拷贝到VB6中也可编译。
把DLL拷贝到所写的VB工程目录下,然后把下面的声明加进去,就可调用了。。。。。。
Public Class Form1
Declare Function EncodeMIME Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function DecodeMIME Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function EncodeXXE Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function DecodeXXE Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function EncodeUUE Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function DecodeUUE Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Declare Function MD5 Lib "CryptPrj.dll" (ByVal lpszSource As String, ByVal lpszDst As String) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String
Dim str2 As String
str1 = Space(255)
str2 = TextBox1.Text
Select Case ComboBox1.SelectedIndex
Case 0
EncodeMIME(str2, str1)
Case 1
EncodeXXE(str2, str1)
Case 2
EncodeUUE(str2, str1)
Case 3
MD5(str2, str1)
End Select
TextBox2.Text = str1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim str1 As String
Dim str2 As String
str1 = Space(255)
str2 = TextBox1.Text
Select Case ComboBox1.SelectedIndex
Case 0
DecodeMIME(str2, str1)
Case 1
DecodeXXE(str2, str1)
Case 2
DecodeUUE(str2, str1)
Case 3
str1 = ""
MsgBox("不支持MD5逆运算")
End Select
TextBox2.Text = str1
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 0
End Sub
End Class
[ 本帖最后由 caterpilla 于 2006-8-2 13:52 编辑 ] |
评分
-
查看全部评分
|