Index.aspx
上传用户:cha0314
上传日期:2014-03-02
资源大小:12522k
文件大小:7k
源码类别:

C#编程

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="Index.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.Login.index" %>
  2. <HTML>
  3. <HEAD>
  4. <title>Coffice 系统</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <style type="text/css">
  7. .Vibox { BORDER-RIGHT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: 0px; WIDTH: 150px; COLOR: #003399; PADDING-TOP: 0px; BORDER-BOTTOM: 0px; FONT-STYLE: normal; FONT-FAMILY: "Arial", "Helvetica", "sans-serif"; HEIGHT: 18px }
  8. .Vibutton { BORDER-RIGHT: #006699 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: #006699 1px solid; PADDING-LEFT: 1px; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; MARGIN: 1px; BORDER-LEFT: #006699 1px solid; WIDTH: 60px; COLOR: #006699; PADDING-TOP: 1px; BORDER-BOTTOM: #006699 1px solid; FONT-FAMILY: "宋体"; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff }
  9. .Vitext { FONT-SIZE: 12px; COLOR: white; FONT-FAMILY: "宋体" }
  10. .Mybuttona { background-image:url(../../Images/denglu.jpg); CURSOR: hand;}
  11. .Mybuttonb { background-image:url(../../Images/quxiao.jpg); CURSOR: hand;border: 0px solid; }
  12. -->
  13. </STYLE>
  14. </style>
  15. </HEAD>
  16. <BODY bgcolor="#353467" bgcolor= leftMargin="0" topMargin="0" onload='javascript: if(this.document.all.txtUsername.value=="") this.document.all.txtUsername.focus();else this.document.all.txtPassword.focus();'>
  17. <span id="obj"></span>
  18. <!--
  19. <OBJECT id="ePass" style="LEFT: 0px; TOP: 0px" height="0" width="0" classid="clsid:E740C5DF-3454-46A7-80EC-364D1ADB6CF0" name="ePass" VIEWASTEXT>
  20. </OBJECT>
  21. -->
  22. <!--判断用户是否选择使用USBKey-->
  23. <script language="javascript">
  24. function needUsbKey(){
  25. if (document.index.cb_isNeedUsbKey.checked==true)
  26. {
  27. obj.innerHTML="<OBJECT id='ePass' style='LEFT: 0px; TOP: 0px' height='0' width='0' classid='clsid:E740C5DF-3454-46A7-80EC-364D1ADB6CF0' name='ePass' VIEWASTEXT></OBJECT>";
  28. }
  29. }
  30. </script>
  31. <script language="VBScript">
  32. Dim FirstDigest
  33. Dim Digest 
  34. Digest= "01234567890123456"
  35. dim bErr
  36. 'sub needUsbKey()
  37. ' if  index.cb_isNeedUsbKey.checked =true Then
  38. ' obj.innerHTML="<OBJECT id='ePass' style='LEFT: 0px; TOP: 0px' height='0' width='0' classid='clsid:E740C5DF-3454-46A7-80EC-364D1ADB6CF0' name='ePass' VIEWASTEXT></OBJECT>"
  39. ' end if
  40. 'End sub
  41. sub ShowErr(Msg)
  42. bErr = true
  43. ErrMsg.innerHTML = "<input type='hidden' name='ErrMsg' Value='" & Msg & "'>"
  44. ' MsgBox Msg,0,"提示"
  45. ' Document.Writeln "<FONT COLOR='#FF0000'>"
  46. ' Document.Writeln "<P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P ALIGN='CENTER'><B>ERROR:</B>"
  47. ' Document.Writeln "<P>&nbsp;</P><P ALIGN='CENTER'>"
  48. ' Document.Writeln Msg
  49. ' Document.Writeln " failed, and returns 0x" & hex(Err.number) & ".<br>"
  50. ' Document.Writeln "<P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>"
  51. ' Document.Writeln "</FONT>"
  52. End Sub
  53. function Validate()
  54. Digest = "01234567890123456"
  55. On Error Resume Next
  56. 'Dim TheForm
  57. 'Set TheForm = Document.forms("ValidForm")
  58. 'If Len(TheForm.UserPIN.Value) < 4  Then
  59. ' MsgBox "PIN empty or user pin length less than 4 or so pin length less than 6!!"  
  60. ' Validate = FALSE
  61. ' Exit Function
  62. 'End If
  63. bErr = false
  64. 'Let detecte whether the ePass 1000 Safe Active Control loaded.
  65. 'If we call any method and the Err.number be set to &H1B6, it 
  66. 'means the ePass 1000 Safe Active Control had not be loaded.
  67. ePass.GetLibVersion
  68. If Err.number = &H1B6 Then
  69. ShowErr "Load ePass 1000 Safe Active Control"
  70. Validate = false
  71. Exit function
  72. Else
  73. ePass.OpenDevice 1, ""
  74. If Err then
  75. ShowErr "请勾选使用框,并插入USB_Key!"
  76. Validate = false
  77. ePass.CloseDevice
  78. Exit function
  79. End if
  80. 'ePass.ResetSecurityState 0
  81. dim results
  82. results = "01234567890123456"
  83. results = ePass.GetStrProperty(7, 0, 0)
  84. 'MsgBox results
  85. 'ePass.VerifyUserPIN TheForm.Identity.Value, TheForm.UserPIN.Value
  86. 'ePass.VerifyPIN 0, TheForm.UserPIN.Value
  87. If Err Then
  88. ShowErr "Verify User PIN Failure!!!"
  89. Validate = false
  90. ePass.CloseDevice
  91. Exit function
  92. End If
  93. If Not bErr Then
  94. ePass.ChangeDir &H300, 0, "ASP_DEMO"
  95. If Err then 
  96. ShowErr "Change to demo directory"
  97. Validate = false
  98. ePass.CloseDevice
  99. Exit function
  100. End If
  101. End If
  102. 'Open the first key file.
  103. If Not bErr Then
  104. ePass.OpenFile 0, 1
  105. If Err Then
  106. ShowErr "Open first KEY-file"
  107. Validate = false
  108. ePass.CloseDevice
  109. Exit function
  110. End If
  111. End If
  112. 'Do HASH-MD5-HMAC compute.
  113. If Not bErr Then
  114. Digest = ePass.HashToken (1, 2,"<%=RandData%>")
  115. If Err Then 
  116. ShowErr "HashToken compute"
  117. Validate = false
  118. ePass.CloseDevice
  119. Exit function
  120. End If
  121. DigestID.innerHTML = "<input type='hidden' name='Digest' Value='" & Digest & "'>"
  122. snID.innerHTML = "<input type='hidden' name='SN_SERAL' Value='" & results & "'>"
  123. End If
  124. End If
  125. ePass.CloseDevice
  126. End function
  127. </script>
  128. <form id="index" method="post" runat="server" onsubmit="Validate()">
  129. <span id="DigestID"></span>
  130. <span id="snID"></span>
  131. <span id="ErrMsg"></span>
  132. <table  bgcolor="#353467" cellSpacing="0" cellPadding="0" width="100%" height="100%" border="0" background="../../Images/newface1.jpg" style="background-repeat: no-repeat;
  133. background-attachment: fixed;">
  134. <tr><td width="443">
  135. </tr>
  136. <td width="357" align="center" valign="top">
  137.  <p> </p>
  138. <p> </p>
  139. <p>
  140. <img border="0" src="../../Images/welcome.gif" width="224" height="117"></p>
  141. <p>
  142. <SPAN style="FONT-FAMILY: 黑体; FONT-SIZE: 12pt"><font color=white>用户名:</font></SPAN><asp:textbox id="txtUsername" runat="server" CssClass="Vibox"></asp:textbox><asp:requiredfieldvalidator id="rfvUsername" runat="server" ControlToValidate="txtUsername" ErrorMessage="*"></asp:requiredfieldvalidator><p>
  143. <SPAN style="FONT-FAMILY: 黑体; FONT-SIZE: 12pt"><font color=white>密&nbsp; 码:</font></SPAN><asp:textbox id="txtPassword" runat="server" CssClass="Vibox" TextMode="Password"></asp:textbox><asp:requiredfieldvalidator id="rfvPassword" runat="server" ControlToValidate="txtPassword" ErrorMessage="*"></asp:requiredfieldvalidator><p>
  144. <asp:button id="btnSubmit" BorderWidth=0 BorderStyle=None Width="88" Height="43" runat="server" CssClass="Mybuttona" Text=""></asp:button>&nbsp;<input class="Mybuttonb" style="width=88px;height=43px"  type="reset" value="" name="Submit2"><p>
  145. &nbsp;<span class="Vitext"><asp:CheckBox id="cb_isNeedUsbKey" runat="server" Text="使用USB_Key" Height="10px"></asp:CheckBox><asp:label id="lblErrorMessage" runat="server" Visible="False" ForeColor="Red" Width="128px">错误的用户名和口令</asp:label>
  146. <p>建议在1024*768分辨率下浏览</p></td></tr>
  147. <tr>
  148. </span></font></td>
  149. </tr>
  150. </table>
  151. </form>
  152. </BODY>
  153. </HTML>