没有合适的资源?快使用搜索试试~ 我知道了~
C# 经典购物车流程全代码.docx
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 131 浏览量
2023-04-03
21:50:42
上传
评论
收藏 49KB DOCX 举报
温馨提示
试读
6页
。
资源推荐
资源详情
资源评论
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.ApplicationPat
h);
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 + "";
资源评论
คิดถึง643
- 粉丝: 3921
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功