zoukankan
html css js c++ java
数据加密和解密
if
(
!
File.Exists(
"
c:\\user.ini
"
))
{
StreamWriter sw
=
new
StreamWriter(
"
c:\\user.ini
"
);
string
strName
=
tbName.Text;
string
strPass
=
tbPass.Text;
string
strEncryPass
=
System.Web.Security.FormsAuthentication.
HashPasswordForStoringInConfigFile(strPass,
"
md5
"
);
sw.WriteLine(strName);
sw.WriteLine(strEncryPass);
sw.Close();
//
数据加密函数System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strPass,"md5")
}
else
{
//
从user.ini中读出保存的用户名称和密码,进行比较
StreamReader sr
=
new
StreamReader(
"
c:\\user.ini
"
);
string
strSaveName
=
sr.ReadLine();
string
strSavePass
=
sr.ReadLine();
sr.Close();
string
strInputPass
=
System.Web.Security.FormsAuthentication
.HashPasswordForStoringInConfigFile(tbPass.Text,
"
md5
"
);
if
(strSaveName
!=
tbName.Text
||
strSavePass
!=
strInputPass)
{
Response.Write(
"
用户名称或密码错误!
"
);
mainPanel.Visible
=
false
;
}
else
Response.Write(
"
<script language = javascript>alert('成功登录!')</script>
"
);
}
数据加密
方法一:
查看全文
相关阅读:
windows 设置nginx开机自启动
vue js中解决二进制转图片显示问题
oracle 各种问题
Nginx安装及配置详解包括windows linux 环境
AOP-切面是如何织入到目标对象中的
AOP-通知-笔记
AOP-方法拦截器-笔记
JdkDynamicAopProxy-笔记
Joinpoint继承体系-笔记
AOP-Pointcut-笔记
原文地址:https://www.cnblogs.com/ghd258/p/254963.html
最新文章
文件处理
字符串格式
while
for
if
Redux进阶(一)
快速构建SPA框架SalutJS--项目工程目录 三
快速构建SPA框架SalutJS--项目工程目录 一
快速构建SPA框架SalutJS--项目工程目录 二
快速构建App界面的框架(●'◡'●) -----SalutJs
热门文章
浅谈Web自适应
快速开发Grunt插件----压缩js模板
如何快速开发SPA应用
javascript的api设计原则
Windows系统(windows server) 中安装oracle 11gR2
js刷新页面常用的几种方式
在vue中使用layer弹框
java实体entity<----->map互转
redis常用类型
spring boot jar包做成windows开机自启服务
Copyright © 2011-2022 走看看