这个帖子中有一个,自己去看看。http://expert.csdn.net/Expert/TopicView3.asp?id=1237771
解决方案 »
- 一个控件的定位的问题
- C# 中调用vc dll的问题
- 请教dataGridView 问题
- SOCKET 编程发送和接受数据不能随时进行
- [正则] 能否帮忙写个函数,通过传入一个URL字符串返回某URL参数的值!使用正则,谢绝Request.QueryString
- 怎么样理解"抽像类"这个概念,大家能不能形像的说说!说都有分!
- 源代码下载:www.fy919.com/web.rar
- c#倒计时代码
- win7下打包的wpf程序部署到XP系统打不开
- ToolBar的一个小问题,怎样在鼠标移动在一个ToolBar上的按钮时,按钮的IMAGE变为另为一个图?
- 布尔数据类型的赋值问题?
- !!!!!!!!!!关于GC的好文章!!!!!!!!!!!!!!
字符串试试用这个:
public static string Encrypt(string inputStr)
{
int len = inputStr.Length;
int sum = 10;
char[] encryptedChars = new char[len];
for (int i=0; i<len; i++)
{
encryptedChars[i] = (char)((int)inputStr[i] + sum);
}
char[] newNameStr = new char[len];
for (int i=0; i<len; i++)
{ // reverse the name
newNameStr[i] = encryptedChars[len-1-i];
} for (int i=0; i<len; i++)
{ // reverse the name
encryptedChars[i] = newNameStr[i];
}
return String.Intern(new String(encryptedChars));
}public static string Decrypt(string inputStr)
{
int len = inputStr.Length;
char[] decryptedChars = new char[len];
for (int i=0; i<len; i++)
{
decryptedChars[i] = (char)((int)inputStr[i] - 10);
} char[] newNameStr = new char[len];
for (int i=0; i<len; i++)
{ // reverse the name
newNameStr[i] = decryptedChars[len-1-i];
} for (int i=0; i<len; i++)
{ // reverse the name
decryptedChars[i] = newNameStr[i];
} return String.Intern(new String(decryptedChars));
}
http://www.aspsky.net/article/list.asp?id=2637