C 经典购物车流程全代码

时间:2025-07-01

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文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219