public static void RegisterWCF()
        {
            try
            {
                using (WcfTcpClient<IMemberRetister> client = factory.CreateClient<IMemberRetister>())
                {

                    RegisterInfo ri = new RegisterInfo
                    {
                        ContactQQ = "",
                        Email = "",
                        Phone = "150" + rd.Next(10000000, 99999999).ToString(),
                        RealName = "",
                        RegistrationIP = "192.168.0.0",
                        Status = CN100.Member.Enums.UserStatus.Available,
                        UserName = "******" + rd.Next(100, 10000000).ToString(),
                        UserType = CN100.Member.Enums.UserType.Member,
                        UserPWD = "123456",
                        strength_V = Convert.ToInt16("1")
                    };
                    long userId = client.Channel.RegisterResUserId(ri);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #2
0
        public static void Register(string computerid, bool rightone, bool righttwo, string config, DateTime endtime, string filename, string softcode)
        {
            RegisterInfo ri = new RegisterInfo();

            ri.RightOne = rightone;
            ri.RightTwo = righttwo;
            ri.Config   = config;
            ri.EndTiem  = endtime;
            string content = Json.ToStringEx(ri);

            if (string.IsNullOrEmpty(softcode))
            {
                softcode = "";
            }
            content = Encryptor.DesEncrypt(content, computerid + softcode);
            content = content.Length.ToString().PadLeft(4, '0') + content + Rand.Str_char(1020, true).ToUpper();
            content = content.Substring(0, 1024);

            if (file.Exists(filename))
            {
                file.Delete(filename);
            }
            System.IO.StreamWriter sw = new System.IO.StreamWriter(filename);
            sw.WriteLine(Rand.Str_char(256, true).ToUpper());
            sw.WriteLine(Rand.Str_char(256, true).ToUpper());
            sw.WriteLine(Rand.Str_char(256, true).ToUpper());
            sw.WriteLine(content.Substring(0, 256));
            sw.WriteLine(content.Substring(256, 256));
            sw.WriteLine(content.Substring(512, 256));
            sw.WriteLine(content.Substring(768, 256));
            sw.WriteLine(Rand.Str_char(256, true).ToUpper());
            sw.WriteLine(Rand.Str_char(256, true).ToUpper());
            sw.Flush();
            sw.Close();
        }
Exemple #3
0
 public static RegisterInfo GetRegister()
 {
     if (!_RegisterInfo.Success)
     {
         string filename = PathHelper.Map(cfgHelper.WebRoot + "Wlniao.dll");
         if (!file.Exists(filename))
         {
             string content = "Sorry,您的程序需要注册!\t\t";
             content += "\n\n机器码:" + GetComputerId() + "\t\t";
             content += "\n\n请联系开发商进行注册\t\t";
             //content += "\n电话:13075463371\t\t";
             //content += "\n网址:http://www.wlniao.com\t\t";
             System.IO.StreamWriter sw = new System.IO.StreamWriter(PathHelper.Map(cfgHelper.WebRoot + "Wlniao.dll"));
             sw.Write(content);
             sw.Flush();
             sw.Close();
         }
         else
         {
             string content = "";
             try
             {
                 System.IO.StreamReader sr = new System.IO.StreamReader(filename);
                 //content = sr.ReadToEnd();
                 //content = "";
                 for (int i = 0; i < 9; i++)
                 {
                     if (i >= 3 && i < 7)
                     {
                         content += sr.ReadLine();
                     }
                     else
                     {
                         sr.ReadLine();
                     }
                 }
                 int length = Convert.ToInt32(content.Substring(0, 4));
                 content = content.Substring(4, length);
                 string softcode = Data.KvTableUtil.GetString("SoftCode");
                 if (string.IsNullOrEmpty(softcode))
                 {
                     softcode = "";
                 }
                 content       = Encryptor.DesDecrypt(content, GetComputerId() + softcode);
                 _RegisterInfo = Json.ToObject <RegisterInfo>(content);
             }
             catch { }
         }
     }
     return(_RegisterInfo);
 }
Exemple #4
0
        public void AddOrUpdate(string filename, FileMetadata fileMetadata)
        {
            if (!this.Contains(filename))
            {
                filenames[index] = filename;

                infos[filename] = new RegisterInfo();
                infos[filename].index = index;
                infos[filename].fileData = new FileData();
                infos[filename].fileMetadata = fileMetadata;

                Interlocked.Increment(ref index);
                Interlocked.Increment(ref count);
            }
            else
            {
                infos[filename].fileMetadata = fileMetadata;
            }
        }
Exemple #5
0
 private static RegisterInfo GetRegisterInfo(Window appbarWindow)
 {
     RegisterInfo reg;
     if (registeredWindowInfo.ContainsKey(appbarWindow))
     {
         reg = registeredWindowInfo[appbarWindow];
     }
     else
     {
         reg = new RegisterInfo()
         {
             CallbackId = 0,
             Window = appbarWindow,
             IsRegistered = false,
             Edge = AppBarPosition.Top,
             OriginalStyle = appbarWindow.WindowStyle,
             OriginalPosition = new Point(appbarWindow.Left, appbarWindow.Top),
             OriginalSize = new Size(appbarWindow.ActualWidth, appbarWindow.ActualHeight),
             OriginalResizeMode = appbarWindow.ResizeMode,
         };
         registeredWindowInfo.Add(appbarWindow, reg);
     }
     return reg;
 }
Exemple #6
0
        private void Register()
        {
            try
            {
                var registerUri = Utility.GetServiceUri(OBBContext.Current.MasterInfo.ip,
                                    OBBContext.Current.MasterInfo.servicePort, "register");
                var r = new RegisterInfo();
                r.servicePort = OBBContext.Current.Info.servicePort;
                r.game = OBBContext.Current.GameInfo;

                var postData = JsonConvert.SerializeObject(r);
                var result = JsonConvert.DeserializeObject<JsonResult>(client.UploadString(registerUri, postData));
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
Exemple #7
0
        public static void Register(string computerid,bool rightone,bool righttwo,string config,DateTime endtime,string filename,string softcode)
        {
            RegisterInfo ri=new RegisterInfo();
            ri.RightOne=rightone;
            ri.RightTwo=righttwo;
            ri.Config=config;
            ri.EndTiem=endtime;
            string content=Json.ToStringEx (ri);
            if (string.IsNullOrEmpty(softcode))
            {
                softcode = Data.KvTableUtil.GetString("SoftCode");
            }
            if (string.IsNullOrEmpty(softcode))
            {
                softcode = "";
            }
            content = Encryptor.DesEncrypt(content, computerid + softcode);
            content=content.Length.ToString ().PadLeft (4,'0')+content+Rand.Str_char(1020,true).ToUpper();
            content=content.Substring (0,1024);

            if(file.Exists(filename)){
                file.Delete (filename);
            }
            System.IO.StreamWriter sw=new System.IO.StreamWriter(filename);
            sw.WriteLine (Rand.Str_char(256,true).ToUpper());
            sw.WriteLine (Rand.Str_char(256,true).ToUpper());
            sw.WriteLine (Rand.Str_char(256,true).ToUpper());
            sw.WriteLine (content.Substring(0,256));
            sw.WriteLine (content.Substring(256,256));
            sw.WriteLine (content.Substring(512,256));
            sw.WriteLine (content.Substring(768,256));
            sw.WriteLine (Rand.Str_char(256,true).ToUpper());
            sw.WriteLine (Rand.Str_char(256,true).ToUpper());
            sw.Flush();
            sw.Close();
        }
Exemple #8
0
 public static RegisterInfo GetRegister()
 {
     if (!_RegisterInfo.Success)
     {
         string filename = PathHelper.Map(cfgHelper.WebRoot + "Wlniao.dll");
         if (!file.Exists(filename))
         {
             string content = "Sorry,您的程序需要注册!\t\t";
             content += "\n\n机器码:" + GetComputerId() + "\t\t";
             content += "\n\n请联系开发商进行注册\t\t";
             //content += "\n电话:13075463371\t\t";
             //content += "\n网址:http://www.wlniao.com\t\t";
             System.IO.StreamWriter sw = new System.IO.StreamWriter(PathHelper.Map(cfgHelper.WebRoot + "Wlniao.dll"));
             sw.Write(content);
             sw.Flush();
             sw.Close();
         }
         else
         {
             string content = "";
             try
             {
                 System.IO.StreamReader sr = new System.IO.StreamReader(filename);
                 //content = sr.ReadToEnd();
                 //content = "";
                 for (int i = 0; i < 9; i++)
                 {
                     if (i >= 3 && i < 7)
                     {
                         content += sr.ReadLine();
                     }
                     else
                     {
                         sr.ReadLine();
                     }
                 }
                 int length = Convert.ToInt32(content.Substring(0, 4));
                 content = content.Substring(4, length);
                 string softcode = Data.KvTableUtil.GetString("SoftCode");
                 if (string.IsNullOrEmpty(softcode))
                 {
                     softcode = "";
                 }
                 content = Encryptor.DesDecrypt(content, GetComputerId() + softcode);
                 _RegisterInfo = Json.ToObject<RegisterInfo>(content);
             }
             catch { }
         }
     }
     return _RegisterInfo;
 }
        private bool GetMacRegsiterInfo(ushort address, out RegisterInfo registerInfo)
        {
            rfid.Constants.Result result = Result.NOT_INITIALIZED;
            registerInfo = new RegisterInfo();

            /* Mac Register Info Read */
            try
            {
                result = Reader.MacReadRegisterInfo(address, out registerInfo);
            }
            catch (Exception)
            {
                StatusUpdate("Get Mac Register Info Exception", TextUpdateType.Error);
                return false;
            }

            return true;
        }
 public void Update(RegisterInfo info)
 {
     _registerData.Update(info);
 }
 public void Insert(RegisterInfo info)
 {
     _registerData.Insert(info);
 }
 public void Delete(RegisterInfo info)
 {
     _registerData.Delete(info);
 }
Exemple #13
0
        private static RegisterInfo GetRegisterInfo(Window window, WorkArea workArea)
        {
            RegisterInfo _regInfo;

            if (_windowDict.ContainsKey(window))
            {
                _regInfo = _windowDict[window];

                if (workArea != null)
                {
                    _regInfo.WorkArea = workArea;
                }
            }
            else
            {
                _regInfo = new RegisterInfo()
                {
                    CallbackID = 0,
                    IsRegistered = false,
                    Window = window,
                    WorkArea = workArea,
                    Edge = DockEdge.Top
                };

                _windowDict.Add(window, _regInfo);
            }

            return _regInfo;
        }
Exemple #14
0
        private static void DockAppBar(Window window, WorkArea workArea, DockEdge edge, RegisterInfo regInfo)
        {
            APPBARDATA _appBarData = new APPBARDATA();
            _appBarData.cbSize = Marshal.SizeOf(_appBarData);
            _appBarData.hWnd = new WindowInteropHelper(window).Handle;
            _appBarData.uEdge = (int)edge;

            _appBarData.rc = new RECT()
            {
                Left = (int)Math.Round(workArea.Left),
                Top = (int)Math.Round(workArea.Top),
                Right = (int)Math.Round(workArea.Right),
                Bottom = (int)Math.Round(workArea.Bottom)
            };

            NativeMethods.SHAppBarMessage((int)AppBarMsg.ABM_QUERYPOS, ref _appBarData);

            NativeMethods.SHAppBarMessage((int)AppBarMsg.ABM_SETPOS, ref _appBarData);

            Rect _rect = new Rect(
                _appBarData.rc.Left,
                _appBarData.rc.Top,
                (_appBarData.rc.Right - _appBarData.rc.Left),
                (_appBarData.rc.Bottom - _appBarData.rc.Top)
                );

            window.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
            {
                window.Width = _rect.Width;
                window.Height = _rect.Height;
                window.Top = _rect.Top;
                window.Left = _rect.Left;

                window.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
                {
                    Task.Delay(150).ContinueWith(_ =>
                    {
                        regInfo.Hook = new HwndSourceHook(regInfo.WndProc);
                        regInfo.Source = HwndSource.FromHwnd(_appBarData.hWnd);
                        regInfo.Source.AddHook(regInfo.Hook);
                    });
                }));
            }));
        }
Exemple #15
0
 public rfid.Constants.Result MacReadRegisterInfo(ushort address, out RegisterInfo info)
 {            
     return LakeChabotReader.MANAGED_ACCESS.API_ConfigReadRegisterInfo(address, out info);
 }
Exemple #16
0
        public Result API_ConfigReadRegisterInfo(
            [In]      UInt16       r_Addr,
            [Out] out RegisterInfo r_pInfo
        )
        {
            #if _TRACE_OUT_PUT
            PrintMagToTxt("API_ConfigReadRegisterInfo");
            #endif

            //initial
            r_pInfo = new RegisterInfo();

            Result   result = Result.OK;
            ENUM_CMD TxCmd  = ENUM_CMD.NOTHING;
            byte[]   buf    = new byte[10];
            Array.Clear(buf, 0, buf.Length);

            TxCmd  = ENUM_CMD.CONFIG_READ_REGISTER_INFO;
            buf[0] = (byte)TxCmd;
            buf[1] = (byte)(  r_Addr       & 0xFF );
            buf[2] = (byte)( (r_Addr >> 8) & 0xFF );

            if ( false == SendData(buf) )
                return Result.FAILURE;

            Array.Clear(buf, 0, buf.Length);

            //Check receive data
            if ( false == ReceiveData( TxCmd, ref buf ) )
                return Result.FAILURE;

            //Check result
            result = ConvertResult(buf[1]);
            if (Result.OK != result)
                return result;

            r_pInfo.type            = (RegisterType)buf[2];
            r_pInfo.accessType      = (RegisterProtectionType)buf[3];
            r_pInfo.bankSize        = buf[4];
            r_pInfo.selectorAddress = BitConverter.ToUInt16(buf, 5);
            r_pInfo.currentSelector = BitConverter.ToUInt16(buf, 7);

            return Result.OK;
        }