Example #1
0
        public int GetUserAuthority()
        {
            UserAuthority = 0;
            try
            {
                string           IP1             = CNetTools.GetInstance().getLocalIP();
                string           Mac             = CNetTools.GetInstance().getLocalMac();
                string           IP2             = CNetTools.GetInstance().GetExtranetIP();
                CEncryptionTools encryptionTools = new CEncryptionTools(USerial);
                string           UserKey         = string.Format("{0};{1};{2}", IP1, Mac, IP2);
                Mac = encryptionTools.Encode(IP1);
                Mac = encryptionTools.Decode(Mac);
                if (GetSerial() > 0 && Validate())
                {
                    CServers.GetServers().GetUserName();
                    string Authority = CServers.GetServers().GetUserAuthority(USerial, encryptionTools.Encode(UserKey));
                    if (Authority != "-1")
                    {
                        int.TryParse(encryptionTools.Decode(Authority), out UserAuthority);
                    }
                    else
                    {
                        UserAuthority = -1;
                    }

                    string name = CServers.GetServers().GetUserName();
                }
            }
            catch (Exception ex) {
                //MessageBox.Show(ex.ToString());
            }
            return(UserAuthority);
        }
Example #2
0
 public static CNetTools GetInstance()
 {
     if (null == mCNetTools)
     {
         mCNetTools = new CNetTools();
     }
     return(mCNetTools);
 }