在ASP.net的客户端如何应用USB客户端身份认证产品,例如ikey等产品,没有这个东西的不能进入

qufusongyu 2008-03-05 03:09:44
在ASP.net的客户端如何应用USB客户端身份认证产品,例如ikey等产品,没有这个东西的不能进入
...全文
55 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lstc 2008-04-25
  • 打赏
  • 举报
回复
这个简单,客户端需要安装它提供的ActiveX控件,整个认证的流程可以参考它的SDk,可以用证书,也可以不用证书
QQ:476833461
游北亮 2008-03-05
  • 打赏
  • 举报
回复
学习网上银行,在客户端安装一个ActiveX控件
通过这个控件检测USB Key

BS架构除了这个办法,没有别的办法。
Fooo 2008-03-05
  • 打赏
  • 举报
回复
o
软件介绍: 彩虹的iKey组件Ikey1000驱动程序,iKey组件包括用于iKey 安全令牌的驱动程序和库文件。本文件主要提供关于产品安装、卸载、新功能、最新消息和如何获取信息或者报告问题等一些相关的信息。,XP/Win7/WIN8,可以正常使用,所有的操作系统在安装iKey组件时,都必须要有USB控制器.iKey 2000 开发套件/认证解决方案    - 当使用iKey2000开发套件或者iKey2000的认证解决方案软件进行升级iKey组件时,在安装完毕后,必须重新启动系统,这是因为CIP服务需要查看被iKey组件安装的新的读卡器。    - 在Windows XP下,对于iKey 2000开发套件或者iKey 2000 的认证解决方案软件版本4.5或版本4.6,“系统重启动时,启动CIP”选项必须被禁止。如果你已经安装了iKey 2000开发套件或者iKey 2000 的认证解决方案软件版本4.5或版本4.6,可以参考下列步骤来禁止“系统重启动时,启动CIP”选项: 1. 打开控制面板。 2. 选择“切换到典型视图”。 3. 打开管理工具文件夹。 4. 打开服务控制面板程序。 5. 选择“DkeyServ”。 6. 在服务启动类型中,选择“禁止”。 7. 重新启动你的系统。如果你还没有安装iKey 2000开发套件或者iKey 2000 的认证解决方案软件版本4.5或版本4.6,在执行安装时,可以清除“系统重启动时,启动CIP”选项:    - 在所有的平台上,假如一个更新版本的iKey组件被安装,然后你又安装了iKey 2000开发套件或者iKey 2000 的认证解决方案软件,操作系统有可能不能发现正确的设备,如果出现这种情况,请你重新安装最新版本的iKey组件来修复系统。
namespace ioffice { using iOfficeData; using iofficeservice; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using System; using System.Diagnostics; using System.Resources; using System.Runtime.CompilerServices; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; public partial class login2 : Page { [AccessedThroughProperty("chpwd")] private ImageButton _chpwd; [AccessedThroughProperty("dropBranch")] private DropDownList _dropBranch; [AccessedThroughProperty("frm")] private HtmlForm _frm; [AccessedThroughProperty("help")] private HtmlImage _help; [AccessedThroughProperty("imgLogo")] private HtmlImage _imgLogo; [AccessedThroughProperty("Label1")] private Label _Label1; [AccessedThroughProperty("Label2")] private Label _Label2; [AccessedThroughProperty("Label3")] private Label _Label3; [AccessedThroughProperty("lblLoginID")] private Label _lblLoginID; [AccessedThroughProperty("lblPwd")] private Label _lblPwd; [AccessedThroughProperty("lblSimpleCode")] private Label _lblSimpleCode; [AccessedThroughProperty("login1")] private HtmlImage _login1; [AccessedThroughProperty("login3")] private HtmlImage _login3; [AccessedThroughProperty("ok")] private ImageButton _ok; [AccessedThroughProperty("RequiredFieldValidator1")] private RequiredFieldValidator _RequiredFieldValidator1; [AccessedThroughProperty("txtloginid")] private TextBox _txtloginid; [AccessedThroughProperty("txtpwd")] private TextBox _txtpwd; [AccessedThroughProperty("valSum")] private ValidationSummary _valSum; private HttpCookie cookie; private int i; protected ResourceManager LocRM; public string logintitle; private Mr mr; private iOfficeData.Res Res; private string[] sErrMessage; private iofficeservice.sysSet sysSet; public login2() { base.Init += new EventHandler(this.Page_Init); base.Load += new EventHandler(this.Page_Load); this.mr = new Mr(); this.sysSet = new iofficeservice.sysSet(); this.Res = new iOfficeData.Res(); this.sErrMessage = new string[10]; } private void AccessIni() { this.Session["iSecureLogin"] = 0; this.Session["SerialNumber"] = ""; if (this.mr.InsSession(this.Session.SessionID, this.Request.UserHostAddress) == 1) { this.Response.Redirect("errdog.htm"); } this.imgLogo.Src = StringType.FromObject(this.Application["corplogo"]); //if (DateTime.Compare(DateTime.Today, DateType.FromString("2004-12-20")) >= 0) //{ // Page pgeParent = this; // DbConfig.ShowMessage(ref pgeParent, iOfficeData.Res.GetResource(this.sErrMessage[9], "你的试用期限已到,系统无法启动!请与程序供应商联系!"), "location.replace('http://www.ioffice.cn')", true); //} } private void BindBranch() { this.dropBranch.DataSource = this.mr.GetBranch(0).Tables["branchsel"]; this.dropBranch.DataBind(); } private void chpwd_Click(object sender, ImageClickEventArgs e) { this.UserLogin(1); } private void GotoNext(int iType) { if (iType != 0) { FormsAuthentication.SetAuthCookie(this.txtloginid.Text, false); this.Response.Redirect("chpwd.aspx"); } else { Page page; if (StringType.StrCmp(this.txtpwd.Text, "", false) == 0) { FormsAuthentication.SetAuthCookie(this.txtloginid.Text, false); page = this; DbConfig.ShowMessageAndRedirect(ref page, iOfficeData.Res.GetResource(this.sErrMessage[6], "你的密码为空!为了确保安全,请及时更改你的密码!"), "chpwd.aspx", true); } else { switch (this.mr.NeedIKey()) { case -1: { FormsAuthentication.SetAuthCookie(this.txtloginid.Text, false); string userAgent = this.Request.UserAgent; userAgent = Strings.Mid(userAgent, Strings.InStr(userAgent, "MSIE", CompareMethod.Binary) + 5, 3); if (!Information.IsNumeric(userAgent)) { page = this; DbConfig.ShowMessage(ref page, iOfficeData.Res.GetResource(this.sErrMessage[8], "请选取Microsoft Internet Explorer 6.0或以上版本作为浏览器。否则,将会有部份的iOffice.net功能不能正常使用!"), "/ioffice/default.aspx", true); return; } if (DoubleType.FromString(userAgent) <= 5.0) { page = this; DbConfig.ShowMessage(ref page, iOfficeData.Res.GetResource(this.sErrMessage[7], "你的Microsoft Internet Explorer 版本太低,请及时升级到6.0或以上版本。否则,将会有部份的iOffice.net功能不能正常使用!"), "/ioffice/default.aspx", true); return; } this.Response.Redirect("/ioffice/default.aspx"); return; } case 0: this.Response.Redirect("ikey/userlogin.aspx"); return; case 1: this.Response.Redirect("/ioffice/etoken/useretokenlogin.aspx"); return; } } } } [DebuggerStepThrough] private void InitializeComponent() { } private void LoadIngCookieLoginID() { if (this.Request.Cookies["iofficelogin"] != null) { this.cookie = this.Request.Cookies["iofficelogin"]; this.txtloginid.Text = this.cookie.Values["loginid"]; int num = this.dropBranch.Items.Count - 1; this.i = 0; while (this.i <= num) { if (StringType.StrCmp(this.dropBranch.Items[this.i].Text, this.cookie.Values["branch"], false) == 0) { this.dropBranch.Items[this.i].Selected = true; } this.i++; } this.txtpwd.Text = this.cookie.Values["pwd"]; if (StringType.StrCmp(this.txtpwd.Text, "", false) != 0) { this.cookie.Values["pwd"].Remove(1, this.cookie.Values["pwd"].Length - 1); this.UserLogin(0); } } } private void LocalRes() { ResourceManager manager=null; iOfficeData.Res res = this.Res; if (res.PrepareResource(typeof(login).Assembly, "ioffice.root", ref manager)) { Label lblLoginID = this.lblLoginID; string text = lblLoginID.Text; res.GetResourceEx(ref manager, ref text, "loginid"); lblLoginID.Text = text; lblLoginID = this.lblPwd; text = lblLoginID.Text; res.GetResourceEx(ref manager, ref text, "pwd"); lblLoginID.Text = text; lblLoginID = this.lblSimpleCode; text = lblLoginID.Text; res.GetResourceEx(ref manager, ref text, "simplecode"); lblLoginID.Text = text; res.GetResourceEx(ref manager, ref this.logintitle, "logintitle"); res.GetResourceEx(ref manager, ref this.sErrMessage[1], "sErrMessage1"); res.GetResourceEx(ref manager, ref this.sErrMessage[2], "sErrMessage2"); res.GetResourceEx(ref manager, ref this.sErrMessage[3], "sErrMessage3"); res.GetResourceEx(ref manager, ref this.sErrMessage[4], "sErrMessage4"); res.GetResourceEx(ref manager, ref this.sErrMessage[5], "sErrMessage5"); res.GetResourceEx(ref manager, ref this.sErrMessage[6], "sErrMessage62"); res.GetResourceEx(ref manager, ref this.sErrMessage[7], "sErrMessage7"); res.GetResourceEx(ref manager, ref this.sErrMessage[8], "sErrMessage8"); res.GetResourceEx(ref manager, ref this.sErrMessage[9], "sErrMessage9"); if (res.IsNotSimpChn()) { ImageButton ok = this.ok; text = ok.ImageUrl; res.GetResourceButtonImageURL(ref text); ok.ImageUrl = text; ok = this.chpwd; text = ok.ImageUrl; res.GetResourceButtonImageURL(ref text); ok.ImageUrl = text; HtmlImage help = this.help; text = help.Src; res.GetResourceButtonImageURL(ref text); help.Src = text; help = this.login1; text = help.Src; res.GetResourceButtonImageURL(ref text); help.Src = text; } } res = null; } private void ok_Click(object sender, ImageClickEventArgs e) { this.UserLogin(0); } protected void Page_Init(object sender, EventArgs e) { this.InitializeComponent(); } protected void Page_Load(object sender, EventArgs e) { this.AccessIni(); this.LocalRes(); if (!this.IsPostBack) { this.BindBranch(); this.LoadIngCookieLoginID(); } } private void PwdCookieSet() { this.cookie = new HttpCookie("iofficelogin"); this.cookie.Values.Add("loginid", this.txtloginid.Text); this.cookie.Values.Add("branch", this.dropBranch.SelectedItem.Value); this.cookie.Expires = DateTime.MaxValue; this.Response.AppendCookie(this.cookie); this.cookie = new HttpCookie("iofficeErr"); this.cookie.Values.Add("iofficeneterrset", this.txtpwd.Text + ":ioffice.net"); this.Response.AppendCookie(this.cookie); this.cookie = new HttpCookie("iofficeloginnum"); this.cookie.Values.Add("loginnum", this.mr.GetLoginInf()); //添加 Session["loginnum"] = this.mr.GetLoginInf(); this.Response.AppendCookie(this.cookie); } private void UserLogin(object iType) { int index = this.mr.LoginiOffice(this.sysSet.SafeSql(this.txtloginid.Text), this.txtpwd.Text, this.dropBranch.SelectedItem.Value, this.dropBranch.Visible); if (index == 0) { this.PwdCookieSet(); this.mr.UpLoginInfo(this.Request.UserHostAddress, this.Request.UserHostName); this.sysSet.GetUserStylesSet(); this.GotoNext(IntegerType.FromObject(iType)); } else { Page pgeParent = this; DbConfig.ShowMessage(ref pgeParent, this.sErrMessage[index], "", true); } } protected virtual ImageButton chpwd { get { return this._chpwd; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._chpwd != null) { this._chpwd.Click -= new ImageClickEventHandler(this.chpwd_Click); } this._chpwd = value; if (this._chpwd != null) { this._chpwd.Click += new ImageClickEventHandler(this.chpwd_Click); } } } protected virtual DropDownList dropBranch { get { return this._dropBranch; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._dropBranch != null) { } this._dropBranch = value; if (this._dropBranch != null) { } } } protected virtual HtmlForm frm { get { return this._frm; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._frm != null) { } this._frm = value; if (this._frm != null) { } } } protected virtual HtmlImage help { get { return this._help; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._help != null) { } this._help = value; if (this._help != null) { } } } protected virtual HtmlImage imgLogo { get { return this._imgLogo; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._imgLogo != null) { } this._imgLogo = value; if (this._imgLogo != null) { } } } protected virtual Label Label1 { get { return this._Label1; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._Label1 != null) { } this._Label1 = value; if (this._Label1 != null) { } } } protected virtual Label Label2 { get { return this._Label2; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._Label2 != null) { } this._Label2 = value; if (this._Label2 != null) { } } } protected virtual Label Label3 { get { return this._Label3; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._Label3 != null) { } this._Label3 = value; if (this._Label3 != null) { } } } protected virtual Label lblLoginID { get { return this._lblLoginID; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._lblLoginID != null) { } this._lblLoginID = value; if (this._lblLoginID != null) { } } } protected virtual Label lblPwd { get { return this._lblPwd; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._lblPwd != null) { } this._lblPwd = value; if (this._lblPwd != null) { } } } protected virtual Label lblSimpleCode { get { return this._lblSimpleCode; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._lblSimpleCode != null) { } this._lblSimpleCode = value; if (this._lblSimpleCode != null) { } } } protected virtual HtmlImage login1 { get { return this._login1; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._login1 != null) { } this._login1 = value; if (this._login1 != null) { } } } protected virtual HtmlImage login3 { get { return this._login3; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._login3 != null) { } this._login3 = value; if (this._login3 != null) { } } } protected virtual ImageButton ok { get { return this._ok; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._ok != null) { this._ok.Click -= new ImageClickEventHandler(this.ok_Click); } this._ok = value; if (this._ok != null) { this._ok.Click += new ImageClickEventHandler(this.ok_Click); } } } protected virtual RequiredFieldValidator RequiredFieldValidator1 { get { return this._RequiredFieldValidator1; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._RequiredFieldValidator1 != null) { } this._RequiredFieldValidator1 = value; if (this._RequiredFieldValidator1 != null) { } } } protected virtual TextBox txtloginid { get { return this._txtloginid; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._txtloginid != null) { } this._txtloginid = value; if (this._txtloginid != null) { } } } protected virtual TextBox txtpwd { get { return this._txtpwd; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._txtpwd != null) { } this._txtpwd = value; if (this._txtpwd != null) { } } } protected virtual ValidationSummary valSum { get { return this._valSum; } [MethodImpl(MethodImplOptions.Synchronized)] set { if (this._valSum != null) { } this._valSum = value; if (this._valSum != null) { } } } } }

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧