📄 logonweb.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ChinaSky.Common;
using ChinaSky.APForBNet.Common;
namespace ChinaSky.HN
{
/// <summary>
/// logonWeb 的摘要说明。
/// </summary>
public class logonWeb : System.Web.UI.Page
{
private const string callPath ="/loginpage.asp?CompanyCode={0}&opt={1}&code={2}";
protected System.Web.UI.WebControls.Label lblMsg;
private void Page_Load(object sender, System.EventArgs e)
{
string corpId=Request["corpId"];//企业标识
string userId=Request["userId"];//用户标识
string serviceItemId=Request["serviceItemId"];//服务项标识
string userType=Request["userType"];//用户类型 0:普通用户 1:管理员
string timeStamp=Request["timeStamp"];
string userAccount=Request["userAccount"];//用户帐号
string ipAddress=Request["ipAddress"];//用户IP地址
string sessionToken=Request["sessionToken"];/* * MD5(CorpId,UserId, ServiceItemId ApId,UserType,UserAccount,TimeStamp,IpAddres) * */
string s=corpId+userId+ serviceItemId +Config.APID +userType+userAccount+timeStamp+ipAddress;
string strActionId = Guid.NewGuid().ToString();
if ("1" != Config.TestFlag)
{
AuthService.AuthParameter para= new AuthService.AuthParameter();
para.apId=Config.APID;
para.corpId=corpId;
para.ipAddres=ipAddress;
para.serviceItemId=serviceItemId;
//TimeSpan ts1=DateTime.Now.Subtract(DateTime.Parse("1970-01-01"));
para.timeStamp=timeStamp;
para.userAccount=userAccount;
para.userId=userId;
para.userType=userType;
para.sessionToken=sessionToken;
AuthService.AuthResult result= new AuthService.AuthService().isUserLogin(para);
if(result.result!="0")
{
lblMsg.Text=result.result +result.errorInfo;
switch(result.result)
{
case "1001":
lblMsg.Text += "<br>授权信息不存在";
break;
case "1002" :
lblMsg.Text += "<br>授权信息不匹配";
break;
case "9999" :
lblMsg.Text += "<br>其他未知错误";
break;
}
return ;
}
}
string outString=corpId + "20" + "ABCDEF";
string path=Config.Web_usePath + string.Format(callPath,corpId,"20",Cryptogram.Md5Code(outString,""));
Response.Redirect(path);
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -