zoukankan
html css js c++ java
简单的权限管理类
Code
using
System;
using
System.Data;
using
System.Data.SqlClient;
using
System.Text;
using
System.Web.Security;
using
System.Security.Cryptography;
using
DBSql;
namespace
NetManageSystem
{
/**/
///
<summary>
///
AutheLib 的摘要说明。
///
</summary>
public
enum
ModuleType :
int
{
DevMudule
=
0
,
NetMudule
=
3
,
DocMudule
=
6
,
CountMudule
=
10
,
SysMudule
=
13
}
public
enum
Goneng :
int
{
add
=
1
,
delete
=
2
,
Edit
=
3
,
Look
=
4
}
public
class
AutheLib
{
public
AutheLib()
{
//
//
TODO: 在此处添加构造函数逻辑
//
}
public
static
String Encrypt(
string
password)
{
Byte[] clearBytes
=
new
UnicodeEncoding().GetBytes(password);
Byte[] hashedBytes
=
((HashAlgorithm) CryptoConfig.CreateFromName(
"
MD5
"
)).ComputeHash(clearBytes);
return
BitConverter.ToString(hashedBytes);
}
public
static
bool
IsExsit(ModuleType Pro,
string
Nick, Goneng Gon)
{
bool
IsExt
=
false
;
string
strUser
=
"
SELECT * FROM dbo_SysCountTable where UserName='
"
+
Nick
+
"
'
"
;
DataSet ds
=
DbService.ExecuteDataSet(strUser);
string
AccessRight
=
ds.Tables[
0
].Rows[
0
][
"
UserAuthe
"
].ToString();
string
accright
=
AccessRight.Substring((
int
)Pro,(
int
)Gon);
IsExt
=
accright.Substring(accright.Length
-
1
,
1
)
==
"
1
"
?
true
:
false
;
return
IsExt;
}
}
}
本人在长沙, 有工作可以加我QQ4658276
查看全文
相关阅读:
SnagIt 9-12 注册码
【工具推荐】LICEcap –GIF 屏幕录制工具
linux笔记一(基础命令)
C#性能优化:延迟初始化Lazy<T>
CSS3实现漂亮ToolTips
mysql数据库sql优化
精简代码,为网站减负的十大建议
10个简单步骤,完全理解SQL
13个mysql数据库的实用SQL小技巧
MyBatis源码解读(二)
原文地址:https://www.cnblogs.com/jianjialin/p/1371963.html
最新文章
Linux下Ubuntu 操作系统 部署
Incorrect string value: 'xF0x9Fx90xB1' for column ......
docker中部署springboot项目,并且外部访问
Spring Date Jpa 增删改查
weblogic10.3.6补丁升级、卸载、查看
Linux下打war包
JSON与对象之间的转换
一步一步讲解安装NodeJs开发环境
巧用这19条MySQL优化,效率至少提高3倍
线程池是什么?Java四种线程池的使用介绍
热门文章
初识Java程序,编写简单代码?
Java中JDK和JRE的区别是什么?它们的作用分别是什么?
Java是什么?我们为什么要学习Java?
程序员之歌
开发必备工具、插件【ME】
.NET 程序员-开源项目【藏】
【总结】IntelliJ IDEA 插件
【总结】MySQL使用优化
基于.NET平台常用的框架整理【藏】
2015年书单
Copyright © 2011-2022 走看看