<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../HSK_Cls/HSK.MemberCls.asp"-->
<!--#include file="../HSK_Cls/HSK.Label.CommonCls.asp"-->
<!--#include file="../Plus/md5.asp"-->
<%
Dim KSCls
Set KSCls = New User_ClientUnbind
KSCls.HSK_Run()
Set KSCls = Nothing

Class User_ClientUnbind
        Private KS,KSUser,RS
		Private CurrentOpStr,Action,ID,LoginTF
		Private Sub Class_Initialize()
		  Set KS=New PublicCls
		  Set KSUser = New UserCls
		End Sub
        Private Sub Class_Terminate()
		 Set KS=Nothing
		 Set KSUser=Nothing
		End Sub
		%>
		<!--#include file="../HSK_Cls/UserFunction.asp"-->
		<%
       Public Sub loadMain()
		Call KSUser.Head()
		Call KSUser.InnerLocation("解除客户端绑定")
		LoginTF = Cbool(KSUser.UserLoginChecked)
		IF LoginTF = False  Then
			GCls.ComeUrl = GCls.GetUrl()
			Response.Write "<script>top.location.href='Login';</script>"
			Exit Sub
		End If
		If KS.S("Action")="Unbind" Then 
		 	Call DoUnbinding()
		Else
		%>
		<br><br><script language = "JavaScript">
				function CheckForm()
				{
				if ($("#SecurityCode").val()=="")
				  {
					alert("请输入安全密码！");
					$("#SecurityCode").focus();
					return false;
				  }
	              return true;
				  }
				</script>
				  <table width="96%"  border="0" align="center" cellpadding="0" cellspacing="1" class="border">
                    <form name="myform" method="post" action="?Action=Unbind" onSubmit="return CheckForm();">
                    <tr class="title">
                        <td height="30" colspan=2 align="center"><strong>解除互刷助手客户端绑定</strong></td>
                    </tr>
                    <tr class="tdbg">
                      <td width="49%" height="80" align="right">请输入安全密码：</td>
                      <td width="51%"><input style="width:150px;" type="password" id="SecurityCode" maxlength="16" name="SecurityCode" value="" title="安全密码主要用于资金流转、账户安全二层保护作用。&#13;&#10;注：安全密码不是登录密码，只需第一次输入。" /></td>
                    </tr>                   
                    <tr class="tdbg">
                      <td colspan=2 height="40" align="center"><input class="button" name="Submit2" type="submit" value="确定提交" /></td>
                    </tr>
                    <tr class="tdbg">
                      <td colspan=2 height="20" align="center">&nbsp;</td>
                    </tr>
                    <tr class="tdbg">
                      <td colspan=2 height="100" align="center"><div  style="color:red; width:96%; padding:8px; text-align:left; border: 1px #F96 solid; background-color:#FFFEEE"><strong>温馨提示：</strong>为了使用互刷助手客户端的用户资金等安全，软件登录成功后自动与本地电脑硬件绑定，绑定后如果你的账号在别的电脑登录客户端，会提示“您本机的机器码与原绑定的机器码不相符！”，以防止账号密码漏泄时造成不必要损失！<br />
                          如果是您本人要更换电脑登录或重装系统后，请在此先解除客户端的绑定，再用软件重新登录即可。</div></td>
                    </tr>
                    </form>
                </table>
		<%
		End If
       End Sub
	   
	   Sub DoUnbinding()

		IF Md5(Trim(KS.S("SecurityCode")),16) <> KSUser.GetUserInfo("KS_SecurityCode") Then
			KS.AlertHistory "系统提示：\n\n您输入的安全密码不对!","-1"
		End IF	

        Set Rs = Server.CreateObject("Adodb.RecordSet")
        Rs.Open "Select Top 1 KS_MachineCode From KS_User Where UserName = '" & KSUSer.UserName & "'", Conn, 1, 3
        If Not Rs.EOF Then
            Rs("KS_MachineCode") = Null
            Rs.Update
			Response.Write "<script>alert('恭喜！互刷助手与客户端的绑定已解除！');history.back();</script>"
        Else
            Response.Write "Result UnBind Fail"
        End If
        Rs.Close
        Set Rs = Nothing
		
	   End Sub
End Class
%> 
