WebSite/App_Code/SubTool.cs
(开头部分) 11KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Web;
using Model;
using BLL;
public class SubTool
{
public static string getClientIP()
{
string result;
if (HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null) // 判断是否设了代理
{
result = "代理IP";
}
else
{
result =HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
}
return result;
}
public static string getUserLogin(string loginName, string userPwd, int loginType, string userIP)
{
D_User u = new D_User();
D_UserLogin uInfo = u.LoginUser(loginName, userPwd, loginType, userIP);
if (uInfo == null)
{
return "用户不存在!!";
}
else
{
if (string.IsNullOrEmpty(uInfo.Message))
{
HttpContext.Current.Session["shop8517User"] = uInfo.UserId.ToString();
HttpCookie newcookie = new HttpCookie("shop8517User");
//newcookie.Expires = DateTime.Now.AddDays(1);
newcookie.Values["UserId"] = uInfo.UserId.ToString();
newcookie.Values["UserName"] =HttpContext.Current.Server.UrlEncode(uInfo.Username);
newcookie.Values["UserEmail"] = uInfo.UserEmail;
newcookie.Values["UserType"] = uInfo.UserType.ToString();
newcookie.Values["UserCartNum"] ="" ;//定单编号
newcookie.Path = "/";
HttpContext.Current.Response.AppendCookie(newcookie);
return "";
}
else
{
return uInfo.Message;
}
}
}
public static bool CheckUserLogin(string userType)
{
HttpCookie newcookie = HttpContext.Current.Request.Cookies["shop8517User"];
后面还有 220 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
