- 浏览: 319117 次
- 性别:
- 来自: 天津
文章分类
最新评论
-
杞哈哈:
你好。我是个新手。去官网也没下载下来那个服务器端。有现成的吗? ...
初探JAXER -
sl514:
http://www.bejson.com
JSON学习 -
sl514:
你可以使用JSON在线格式化、校验、视图工具 http://w ...
JSON学习 -
srg23:
好像在FF下不兼容。
教你怎么使网页全部变成灰色的! -
vera_sq:
你的方法我试过,还是不行呢!
AJAX技术使用XMLHttpRequest对象传递参数的中文乱码问题
1、方法一 (不可逆加密) srxljl
public string EncryptPassword(string PasswordString,string PasswordFormat )
...{
string encryptPassword = null;
if (PasswordFormat="SHA1")...{
encryptPassword=FormsAuthortication.HashPasswordForStoringInConfigFile(PasswordString ,"SHA1");
}
elseif (PasswordFormat="MD5")
...{ encryptPassword=FormsAuthortication.HashPasswordForStoringInConfigFile(PasswordString ,"MD5");
}
return encryptPassword ;
}
...{
string encryptPassword = null;
if (PasswordFormat="SHA1")...{
encryptPassword=FormsAuthortication.HashPasswordForStoringInConfigFile(PasswordString ,"SHA1");
}
elseif (PasswordFormat="MD5")
...{ encryptPassword=FormsAuthortication.HashPasswordForStoringInConfigFile(PasswordString ,"MD5");
}
return encryptPassword ;
}
2、方法二 (可逆加密)srxljl
public interface IBindesh
...{
string encode(string str);
string decode(string str);
}
public class EncryptionDecryption : IBindesh
...{
public string encode(string str)
...{
string htext = "";
for ( int i = 0; i < str.Length; i++)
...{
htext = htext + (char) (str[i] + 10 - 1 * 2);
}
return htext;
}
public string decode(string str)
...{
string dtext = "";
for ( int i=0; i < str.Length; i++)
...{
dtext = dtext + (char) (str[i] - 10 + 1*2);
}
return dtext;
}
...{
string encode(string str);
string decode(string str);
}
public class EncryptionDecryption : IBindesh
...{
public string encode(string str)
...{
string htext = "";
for ( int i = 0; i < str.Length; i++)
...{
htext = htext + (char) (str[i] + 10 - 1 * 2);
}
return htext;
}
public string decode(string str)
...{
string dtext = "";
for ( int i=0; i < str.Length; i++)
...{
dtext = dtext + (char) (str[i] - 10 + 1*2);
}
return dtext;
}
3、方法三 (可逆加密)srxljl
const string KEY_64 = "VavicApp";//注意了,是8个字符,64位
const string IV_64 = "VavicApp";
public string Encode(string data)
...{
byte[] byKey = System.Text.ASCIIEncoding.ASCII.GetBytes(KEY_64);
byte[] byIV = System.Text.ASCIIEncoding.ASCII.GetBytes(IV_64);
DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
int i = cryptoProvider.KeySize;
MemoryStream ms = new MemoryStream();
CryptoStream cst = new CryptoStream(ms, cryptoProvider.CreateEncryptor(byKey, byIV), CryptoStreamMode.Write);
StreamWriter sw = new StreamWriter(cst);
sw.Write(data);
sw.Flush();
cst.FlushFinalBlock();
sw.Flush();
return Convert.ToBase64String(ms.GetBuffer(), 0, (int)ms.Length);
}
public string Decode(string data)
...{
byte[] byKey = System.Text.ASCIIEncoding.ASCII.GetBytes(KEY_64);
byte[] byIV = System.Text.ASCIIEncoding.ASCII.GetBytes(IV_64);
byte[] byEnc;
try
...{
byEnc = Convert.FromBase64String(data);
}
catch
...{
return null;
}
DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream(byEnc);
CryptoStream cst = new CryptoStream(ms, cryptoProvider.CreateDecryptor(byKey, byIV), CryptoStreamMode.Read);
StreamReader sr = new StreamReader(cst);
return sr.ReadToEnd();
}
4,md5(32位加密) srxljl
public string GetMD5(string s, string _input_charset)
...{
/**//// <summary>
/// 与ASP兼容的MD5加密算法
/// </summary>
MD5 md5 = new MD5CryptoServiceProvider();
byte[] t = md5.ComputeHash(Encoding.GetEncoding(_input_charset).GetBytes(s));
StringBuilder sb = new StringBuilder(32);
for (int i = 0; i < t.Length; i++)
...{
sb.Append(t[i].ToString("x").PadLeft(2, '0'));
}
return sb.ToString();
}
...{
/**//// <summary>
/// 与ASP兼容的MD5加密算法
/// </summary>
MD5 md5 = new MD5CryptoServiceProvider();
byte[] t = md5.ComputeHash(Encoding.GetEncoding(_input_charset).GetBytes(s));
StringBuilder sb = new StringBuilder(32);
for (int i = 0; i < t.Length; i++)
...{
sb.Append(t[i].ToString("x").PadLeft(2, '0'));
}
return sb.ToString();
}
(16位加密)srxljl
public static string GetMd5Str(string ConvertString)
...{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8);
t2 = t2.Replace("-", "");
return t2;
}
...{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string t2 = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString)), 4, 8);
t2 = t2.Replace("-", "");
return t2;
}
5、加解文本文件srxljl
//加密文件
private static void EncryptData(String inName, String outName, byte[] desKey, byte[] desIV)
...{
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
DES des = new DESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, des.CreateEncryptor(desKey, desIV), CryptoStreamMode.Write);
//Read from the input file, then encrypt and write to the output file.
while (rdlen < totlen)
...{
len = fin.Read(bin, 0, 100);
encStream.Write(bin, 0, len);
rdlen = rdlen + len;
}
encStream.Close();
fout.Close();
fin.Close();
}
//解密文件
private static void DecryptData(String inName, String outName, byte[] desKey, byte[] desIV)
...{
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
DES des = new DESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, des.CreateDecryptor(desKey, desIV), CryptoStreamMode.Write);
//Read from the input file, then encrypt and write to the output file.
while (rdlen < totlen)
...{
len = fin.Read(bin, 0, 100);
encStream.Write(bin, 0, len);
rdlen = rdlen + len;
}
encStream.Close();
fout.Close();
fin.Close();
}
private static void EncryptData(String inName, String outName, byte[] desKey, byte[] desIV)
...{
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
DES des = new DESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, des.CreateEncryptor(desKey, desIV), CryptoStreamMode.Write);
//Read from the input file, then encrypt and write to the output file.
while (rdlen < totlen)
...{
len = fin.Read(bin, 0, 100);
encStream.Write(bin, 0, len);
rdlen = rdlen + len;
}
encStream.Close();
fout.Close();
fin.Close();
}
//解密文件
private static void DecryptData(String inName, String outName, byte[] desKey, byte[] desIV)
...{
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
DES des = new DESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, des.CreateDecryptor(desKey, desIV), CryptoStreamMode.Write);
//Read from the input file, then encrypt and write to the output file.
while (rdlen < totlen)
...{
len = fin.Read(bin, 0, 100);
encStream.Write(bin, 0, len);
rdlen = rdlen + len;
}
encStream.Close();
fout.Close();
fin.Close();
}
发表评论
-
vs2005操作水晶报表(入门示例)
2008-06-27 17:14 6564vs2005操作水晶报表(入 ... -
C# 字符串DES加/解密与MD5加密类
2008-06-10 17:02 5621C#源码,用.Net封装的类库写的加密和解密的方法,很容易转换 ... -
打印gridview
2008-06-10 16:01 2708打印指定内容: 代码就是这样的. <html> ... -
ASP.NET验证控件祥解
2008-06-10 01:56 1455ASP.NET是微软推出的下一代WEB开发工具,其强大的功能立 ... -
ASP.Net中MD5和SHA1加密的几种方法
2008-06-10 01:55 1609首先简单介绍一下MD5和SHA1:MD5的全称是Message ... -
Asp.net中的日期处理函数
2008-05-22 14:33 1051//2007年4月24日 this.Te ... -
LINQ to SQL语句之Select/Distinct和Count/Sum/Min/Max/Av
2008-05-14 18:02 5544顺便说了一下Where操作 ... -
LINQ简介和LINQ to SQL语句之Where
2008-05-14 17:21 1838查询表达式(LINQ)简介 在 ... -
C# 3.0新语言特性和改进(下篇)
2008-05-14 17:05 1278上一篇我们介绍了C# 3.0 ... -
C# 3.0新语言特性和改进(上篇)
2008-05-14 11:19 1456Visual Studio 2008和.NET 3.5是建立在 ... -
C#SQL数据库操作类
2008-05-13 12:31 2635using System;using System.Confi ... -
C#.net常用函数和方法集汇总
2008-05-13 12:27 9471、DateTime 数字型 System.D ... -
ASP.NET应用程序设计的10大技巧
2008-05-13 12:27 954在本篇文章中,我们将讨论编程人员在使用ASP.NET开发应用程 ... -
asp.net开发常用技巧收集
2008-05-13 12:25 13571. 打开新的窗口并传送参数: 传送参数: response. ... -
C#DateTime函数
2008-05-13 12:24 20241、DateTime 数字型 System.DateTime ... -
对MemoryStream进行压缩、加密
2008-05-13 11:50 2250在应用DeflateStream 或GZipStream进行压 ... -
内存流MemoryStream
2008-05-13 11:41 3626编程访问文件是通过文件流对象进行的,当应用程序需要访问文件时, ... -
.net验证码 创建 CreateRandomCode CreateImage
2008-05-13 11:03 2005新建一个专门用来创建验证码图片的页面image.aspx它的 ... -
一步一步学Linq to sql(一):预备知识
2008-05-13 09:34 854什么是Linq to sql Linq to ... -
ASP.net初学者常用知识
2008-05-10 01:23 1142一位ASP.net初学者学习过程中整理的备忘录,包括“打开新的 ...
相关推荐
基于matlab实现的数值计算及金融运用 ,金融时间序列数据分析 ,MATLAB和其他软件数据连接.rar
使用SegNet进行语义分割-python源码.zip
JSP企业电子投票系统 2
EmotionVGGnet情绪识别-python源码.zip
基于matlab实现的遗传算法、模拟退火算法、禁忌搜索算法求解VRP问题的matlab程序.rar
大数据Python科学计算库-Numpy实战:numpy代码 练习题.ipynb 9-读写.ipynb 8-随机模块.ipynb 7-运算.ipynb 6-数组 生成.ipynb 5-数组形状.ipynb 4-排序.ipynb 3-数值计算. ipynb 2-array结构.ipynb 1-Numpy概述.ipynb 1- Numpy概述.ipynb 2-array结构.ipynb 3-数值计算.ipy nb 4-排序.ipynb 5-数组形状.ipynb 6-数组生成.ipynb 7-运算.ipynb 8-随机模块.ipynb 9-读写.ipynb 练习题.i pynb
本文档是课题研究的研究报告内含调研以及源码设计以及结果分析
基于BlazePose+KNN实现人体姿态健身计数算法python源码+项目说明.zip 项目描述: 实现基于mediapipe的人体姿态识别的AI健身自动计数功能 支持健身动作:1、俯卧撑 2、深蹲 3、引体向上 4、仰卧起坐 创建时间:2022.11.28 完成时间:2022.11.28 如何训练新的健身动作模型? 1、修改mian函数 2、首先在fitness_pose_images_in的文件夹下存储对应健身的初态动作与末态动作图像 3、修改videoprocess.py文件中的代码,flag模式选择部分,注意class_name必须与fitness_pose_images_in文件夹下的文件名字保持一致 4、修改videoprocess.py文件中的代码,flag模式选择部分,注意class_name必须与fitness_pose_images_in文件夹下的文件名字保持一致 5、修改trainingsetprocess.py文件中的代码,flag模式选择部分,注意 文件名 必须与fitness_pose_images_in文件夹下的文件名字保持一
Dijkstra 算法,又称为迪杰斯特拉算法,是一种用于解决单源最短 路径问题的经典算法。它的核心思想是通过逐步确定起点到其他顶 点的最短路径来求解。该算法被广泛应用于图论和网络路由等领域。 Dijkstra 算法的基本步骤如下: 1. 创建一个距离数组 dist[] ,用于存储起点到各个顶点的最短距离。 将起点的最短距离初始化为 0,其他顶点的最短距离初始化为无穷 大。 2. 创建一个集合 S ,用于存储已经找到最短路径的顶点。 3. 重复以下步骤,直到集合 S 包含所有顶点: a. 从距离数组 dist[]中选择最小值对应的顶点 v,将 v 加入集合 S。 b. 更新距离数组 dist[] : - 对于每个与 v 相邻的顶点 u,如果通过顶点 v 可以获得更短的 路径,则更新 dist[u]为更短的距离。 c. 重复步骤 a 和 b,直到集合 S 包含所有顶点。 4. 最终,距离数组 dist[]中存储的就是起点到各个顶点的最短路径。 下面通过一个简单的例子来说明 Dijkstra 算法的具体过程。假设有 一个带权有向图,其中的顶点和边分别如下所示:
Node.js,简称Node,是一个开源且跨平台的JavaScript运行时环境,它允许在浏览器外运行JavaScript代码。Node.js于2009年由Ryan Dahl创立,旨在创建高性能的Web服务器和网络应用程序。它基于Google Chrome的V8 JavaScript引擎,可以在Windows、Linux、Unix、Mac OS X等操作系统上运行。 Node.js的特点之一是事件驱动和非阻塞I/O模型,这使得它非常适合处理大量并发连接,从而在构建实时应用程序如在线游戏、聊天应用以及实时通讯服务时表现卓越。此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也被用于构建工具链、开发桌面应用程序、物联网设备等。Node.js能够处理文件系统、操作数据库、处理网络请求等,因此,开发者可以用JavaScript编写全栈应用程序,这一点大大提高了开发效率和便捷性。 在实践中,许多大型企业和组织已经采用Node.js作为其Web应用程序的开发平台,如Netflix、PayPal和Walmart等。它们利用Node.js提高了应用性能,简化了开发流程,并且能更快地响应市场需求。
IEC 60695-11-3:2012.pdf
机械设计电话自动组装产线非常好的设计图纸100%好用.zip
010editor是一款小巧专业的实用型编程工具,010editor官方版功能强悍,便捷好用,支持用户进行编辑十六进制和二进制,可选择自己需要的进制进行编辑,还可对任何的文件进行编辑。
点上面 附件图标,上传附件后可设置现金定价 2007-2022年各省份节能环保 支出占一般预算支出面板数据 已经整理成省级面板数据 手动整理不易
Node.js,简称Node,是一个开源且跨平台的JavaScript运行时环境,它允许在浏览器外运行JavaScript代码。Node.js于2009年由Ryan Dahl创立,旨在创建高性能的Web服务器和网络应用程序。它基于Google Chrome的V8 JavaScript引擎,可以在Windows、Linux、Unix、Mac OS X等操作系统上运行。 Node.js的特点之一是事件驱动和非阻塞I/O模型,这使得它非常适合处理大量并发连接,从而在构建实时应用程序如在线游戏、聊天应用以及实时通讯服务时表现卓越。此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也被用于构建工具链、开发桌面应用程序、物联网设备等。Node.js能够处理文件系统、操作数据库、处理网络请求等,因此,开发者可以用JavaScript编写全栈应用程序,这一点大大提高了开发效率和便捷性。 在实践中,许多大型企业和组织已经采用Node.js作为其Web应用程序的开发平台,如Netflix、PayPal和Walmart等。它们利用Node.js提高了应用性能,简化了开发流程,并且能更快地响应市场需求。
保护大堡礁(pytorch + yolov5训练自定义数据集)-python源码.zip
PPT经典背景音乐库 名称: 电视台常用图片呈现背景音乐 名称: 雄伟大气的曲子
unet + pytorch 一个实例-python源码.zip
基于matlab实现的数学形态滤波器用于旋转机械的振动信号的降噪.rar
jsp高校学生考勤管理系统设计与实现(源代码+论文)