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
查看全文
相关阅读:
计算GPS WGS_84 两点的距离
极路由4_开ssh_刷breed
aes-256-gcm_python3_php7_golang
nginx_非标准端口_同端口_http_自动跳转_https
配置sshd_除了特定ip外_仅密钥登录
使用scp命令实现服务器之间文件传输
Java防止重复提
mysql使用SUBSTRING_INDEX截取部分字符串
SEO大杀器rendertron安装
PIC16 bootloader之I2C bootloader
原文地址:https://www.cnblogs.com/jianjialin/p/1371963.html
最新文章
php通过php的redis模块取回的值得类型判断
thinkphp中的lock与mysql的for update的使用注意事项
ubuntu上php-fpm无法启动也无任何日志输出
Thinkphp5.1的session类型为redis,并指定redis的数据库
thinkphp5.1的模板路径的配置及对应情况
php中ObjectId类的使用
php通过mongdb的objectid来创建24位的唯一字符串
mac上phpstorm突然不显示字符串‘);’的解决办法
php接入友盟智能认证U-Verify一键登录
ORA-12532、ORA-12154 SQLPLUS登陆时密码带@怎么办
热门文章
4步linux下oracle开机自启动
postgres 10 时区修改
Oracle 监听密码设置
WakeOnLan_WOL_本地_远程_跨网段
windows_10_2008r2_2016server_开机startup_关机shutdown_分别执行bat脚本
Linux_PVE_e1000e网卡Hang
NFS配置_CentOS8_firewalld_win2016_群晖DSM
体积很小的nginx_php7.4_docker_在unraid中的配置
UnRAID_6.9.1_配置_设置
ProxmoxVE_PVE防火墙_本机静态路由_本机端口转发_修改默认8006端口_旁路由VM
Copyright © 2011-2022 走看看