手机版

C 经典购物车流程全代码

时间:2025-04-24   来源:未知    
字号:

C# 经典购物车流程全代码 asp.net 经典毕业设计

C# 购物车 及后台代码

C# 程序语言

一.防止SQL注入

public static bool SqlFilter2(string InText)

{ string word = "and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join|'"; if (InText == null)

return false;

foreach (string str_t in word.Split('|'))

{if ((InText.ToLower().IndexOf(str_t + " ") > -1) || (InText.ToLower().IndexOf(" " + str_t) > -1) || (InText.ToLower().IndexOf(str_t) > -1))

{ return true;//返回有}

}

}

二.MD5加密

using system.web.security

string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox2.Text,"MD5");

四..配置文件的加密与解密

数据库连接字符串

<appSettings>

<add key=”ConnectionString” value=”server=(Local);database = test; pwd=sa;uid=sa;”/> </appSettings

加密

Configurationconfig=WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);

ConfigurationSection section config.GetSection(”appSettings”);

if(section !=null && !section.SectionInformation.IsProtected)

{ Section.SectionInformation.ProtectSection(”RsaProtectedConfigurationProvider”); Config.Save();

}

解密

Configuration

config=WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection section =config.GetSection(“appSettings”);

If(section !=null && secion.SectionInformation.IsProtected)

{Section SectionInformation.UnprotectSection();

Config.Save();

}

五.邮件的发送和接收

Encoding encoding = Encoding.GetEncoding("GB2312");

string address = TextBox1.Text.Trim();

string biaoti = "购物网用户激活";

string content = "status.aspx?id=" + TextBox2.Text + "";

C 经典购物车流程全代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)