c# asp.net 字符串加密解密的类
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;//Cryptography密码术
namespace DAL
{
public class Encry
{
public Encry() { }
#region AES加密
public static string Encrypt(string toEncrypt)
{
byte[] keyArray = UTF8Encoding.UTF8.GetBytes("12345678901234567890123456789012");
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
RijndaelManaged rDel = new RijndaelManaged();//using System.Security.Cryptography;
rDel.Key = keyArray;
rDel.Mode = CipherMode.ECB;//using System.Security.Cryptography;
rDel.Padding = PaddingMode.PKCS7;//using System.Security.Cryptography;
ICryptoTransform cTransform = rDel.CreateEncryptor();//using System.Security.Cryptography;
&nbs
相关文档:
在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......
今天,学习了ASP.NET中连接数据库的各种方法,这是我自己的一个小总结,不一定完全正确,仅供参考! O(∩_∩)O~
连接SQL数据库的方法:
(一)、在Web.Config中创建连接字符串:
1、
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename= ......
这个属性是用来验证客户端用户的输入的,用来验证用户的输入中是否有危险字符的,这个属性的默认值为true,微软之所以这么做是为了提高asp.net程序的安全性,所以很多程序员即使不知道怎么来防御黑客的攻击,asp.net的一些默认属性等内容已经对安全进行了控制,这也是为什么asp.net的程序相对来说比较安全的原因!
既然这个属 ......
asp.net发布网站时三个选项的问题
发布网站的时候有三个选项:
第一个选项指定发布后是不是可以修改aspx文件,如果勾选,则发布后的网站行为基本与ASP.NET 1.1一致,只要没有增删修改控件,可以直接在服务器上修改aspx文件不用重新发布网站。
第二个选项指定是不是将每个aspx文件都编 ......