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
查看全文
相关阅读:
proxy
javascript作用域链
javascript技巧
for of
ES6模块与CommonJS模块有什么区别?
DOM
defer和async的区别
浏览器如何解析css选择器?
你是如何理解Vue的响应式系统的
信息安全系统设计基础第十二周学习总结
原文地址:https://www.cnblogs.com/jianjialin/p/1371963.html
最新文章
jQuery
前端基础之BOM和DOM
前端基础之JavaScript
CSS属性相关
前端基础之CSS
28.6 Integer 自动装箱和拆箱
28.5 Integer-- int的包装类
28.4 Calendar 日历
28.3 api--date 日期 (日期获取、格式化)
28.2 api-- System (gc、arraycopy、exit)
热门文章
28 api的使用2
27.2 匿名内部类应用场景
27.1 匿名内部类的使用
27 内部类的使用
26.2修饰符及其使用场景
26.1 包和权限修饰符
26 包和权限修饰符
25.3 多态的优缺点及应用
25.2 多态向上向下类型转换
Set 和 Map
Copyright © 2011-2022 走看看