| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 419 人关注过本帖
标题:求助,VB调用MD5
只看楼主 加入收藏
conquereo
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-4-9
收藏
 问题点数:0 回复次数:0 
求助,VB调用MD5
我有一VB写的DLL供网站调用.网站注册登陆密码需要MD5加密.大侠们帮帮忙  俺一小白..感激不尽.代码如下
Rem 注冊
Public Sub doReg()

On Error GoTo ErrHandle

    Dim sStr, sUserId, sPassword, sPassword2, sSupterPassword, sSex
    Dim sUserName, sEmail, sQQ, sMSN, sValidCode, sIP, sAdUserNum, sAdIp
    sUserId = ChkSql(Request.Form("Userid"))
    sPassword = ChkSql(Request.Form("Password"))
    sPassword2 = ChkSql(Request.Form("passwd"))
    sEmail = ChkSql(Request.Form("email"))
    sSex = ChkSql(Request.Form("sex"))
    sUserName = ChkSql(Request.Form("username"))
    sQQ = ChkSql(Request.Form("qq"))
    sMSN = ChkSql(Request.Form("msn"))
    sIP = getIP
    sValidCode = Request.Form("verifycode")
   
    If Session("ValidCode") <> sValidCode Then
        Response.Write cHtml.ShowAlter("驗証碼錯誤!", 2)
        Exit Sub
    End If
   
    sAdUserNum = Session("AdUserNum")
    sAdIp = Session("AdIp")
    If Len(sAdUserNum) = 0 Or Len(sAdIp) = 0 Then
        sAdUserNum = 0
        sAdIp = 1
    End If
   
    sStr = "@UserName|200|1|20|" & sUserName & "~~"
    sStr = sStr & "@UserID|200|1|20|" & sUserId & "~~"
    sStr = sStr & "@UserPass|200|1|20|" & sPassword & "~~"
    sStr = sStr & "@UserPass2|200|1|20|" & sPassword2 & "~~"
    sStr = sStr & "@Email|200|1|20|" & sEmail & "~~"
    sStr = sStr & "@Sex|200|1|20|" & sSex & "~~"
    sStr = sStr & "@QQ|200|1|20|" & sQQ & "~~"
    sStr = sStr & "@MSN|200|1|20|" & sMSN & "~~"
    sStr = sStr & "@IP|200|1|20|" & sIP & "~~"
    sStr = sStr & "@ADUserNum|20|1|8|" & sAdUserNum & "~~"
    sStr = sStr & "@ADIP|200|1|20|" & sAdIp
   
    Select Case cDataBase.ExecuteProc("Web_Register", sStr)
        Case 0:
            Response.Write cHtml.ShowAlter("注冊成功\n  Θ !", 2)
        Case 1:
            Response.Write cHtml.ShowAlter("帳號已存在\nID    !", 2)
        Case 2:
            Response.Write cHtml.ShowAlter("帳號已存在\nID    !", 2)
        Case 3:
            Response.Write cHtml.ShowAlter("未知原因,注冊失敗\n    ,   毖!", 2)
    End Select
   
    cDataBase.CloseConn
   
    Exit Sub
   
ErrHandle:

    Response.Write Err.Description
   
End Sub

登陆
Public Sub doLogin()

On Error GoTo ErrHandle

    Dim rs, sUserId, sUserNum, sUserName, sQQ, sEmail, sMSN
    Dim sSex, sPoint, sMoney, sChanged, sPassword, sUserType
   
    sUserId = ChkSql(Request.Form("Userid"))
    sPassword = ChkSql(Request.Form("Password"))
   
    Set rs = cDataBase.RecordSet("Select * from RanUser.dbo.FullUserInfo a,RanUser.dbo.UserInfo b,RanGame1.dbo.Web_Userinfo c" & _
                                 " Where a.UserId='" & sUserId & _
                                 "' And a.UserPass ='" & sPassword & "' And a.UserId = b.UserId and b.UserNum=c.UserNum")

    If rs.BOF Or rs.EOF Then
        Response.Write cHtml.ShowAlter("用戶名或密碼錯誤!", 2)
        cDataBase.CloseConn
        Exit Sub
    End If
        sUserId = rs("UserId")
        sUserNum = rs("UserNum")
        sUserName = rs("UserName")
        sQQ = rs("QQ")
        sEmail = rs("Email")
        sMSN = rs("MSN")
        sSex = rs("Sex")
        sPoint = rs("Point")
        sMoney = rs("Money")
        sChanged = rs("Changed")
        sUserType = rs("UserType")
        
搜索更多相关主题的帖子: email 
2011-04-09 10:58
快速回复:求助,VB调用MD5
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026727 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved