 
                    
                
         
    
    
    
	
	
		
    
    
        
            
            
            
                
![]()
![]() Code
Code
![]() using System;
using System;
![]() using System.Data;
using System.Data;
![]() using System.Data.SqlClient;
using System.Data.SqlClient;
![]() using System.Text;
using System.Text;
![]() using System.Web.Security;
using System.Web.Security;
![]() using System.Security.Cryptography;
using System.Security.Cryptography;
![]() using DBSql;
using DBSql;
![]()
![]() namespace NetManageSystem
namespace NetManageSystem
![]()
![]()
![]() {
{
![]()
![]() /**//// <summary>
    /**//// <summary>
![]() /// AutheLib 的摘要说明。
    /// AutheLib 的摘要说明。
![]() /// </summary>
    /// </summary>
![]() public enum ModuleType : int
    public enum ModuleType : int
![]()
![]() 
    ![]() {
{
![]() DevMudule = 0,
        DevMudule = 0,
![]() NetMudule = 3,
        NetMudule = 3,
![]() DocMudule = 6,
        DocMudule = 6,
![]() CountMudule = 10,
        CountMudule = 10,
![]() SysMudule = 13
        SysMudule = 13
![]()
![]() }
    }
![]() public enum Goneng : int
    public enum Goneng : int
![]()
![]() 
    ![]() {
{
![]() add = 1,
        add = 1,
![]() delete = 2,
        delete = 2,
![]() Edit = 3,
        Edit = 3,
![]() Look = 4
        Look = 4
![]() }
    }
![]() public class AutheLib
    public class AutheLib
![]()
![]() 
    ![]() {
{
![]() public AutheLib()
        public AutheLib()
![]()
![]() 
        ![]() {
{
![]() //
            //
![]() // TODO: 在此处添加构造函数逻辑
            // TODO: 在此处添加构造函数逻辑
![]() //
            //
![]() }
        }
![]()
![]() public static String Encrypt(string password)
        public static String Encrypt(string password) 
![]()
![]() 
        ![]() {
{
![]() Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
            Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
![]() Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
            Byte[] hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
![]() return BitConverter.ToString(hashedBytes);
            return BitConverter.ToString(hashedBytes);
![]() }
        }    
![]() 
        
![]()
![]() public static bool IsExsit(ModuleType Pro, string Nick, Goneng Gon)
        public static bool IsExsit(ModuleType Pro, string Nick, Goneng Gon)
![]()
![]() 
        ![]() {
{
![]() bool IsExt = false;
            bool IsExt = false;
![]() string strUser = "SELECT * FROM dbo_SysCountTable where UserName='"+Nick+"'";
            string strUser = "SELECT * FROM dbo_SysCountTable where UserName='"+Nick+"'";
![]() DataSet ds =  DbService.ExecuteDataSet(strUser);
            DataSet ds =  DbService.ExecuteDataSet(strUser);
![]() string AccessRight = ds.Tables[0].Rows[0]["UserAuthe"].ToString();
            string AccessRight = ds.Tables[0].Rows[0]["UserAuthe"].ToString();
![]() string accright = AccessRight.Substring((int)Pro,(int)Gon);
            string accright = AccessRight.Substring((int)Pro,(int)Gon);
![]() IsExt = accright.Substring(accright.Length -1, 1)== "1" ? true : false;
            IsExt = accright.Substring(accright.Length -1, 1)== "1" ? true : false;
![]() return IsExt;
            return IsExt;
![]() }
        }
![]() }
    }
![]() }
}
![]()
 
    本人在长沙, 有工作可以加我QQ4658276
             
            posted @ 
2009-01-08 15:50 
MyCoolDog 
阅读(
233) 
评论() 
 
收藏 
举报