예제 #1
0
 public ComputerCollection(uint serverType, string domain)
 {
     m_computers = ComputerInfo.GetComputerInfo(
         serverType,
         domain,
         out m_lastError);
 }
예제 #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            string computer = ComputerInfo.GetComputerInfo();

            encryptComputer = new EncryptionHelper().EncryptString(computer);
            if (CheckRegist() == true)
            {
                lbRegistInfo.Text = "已注册";
            }
            else
            {
                lbRegistInfo.Text = "待注册,运行十分钟后自动关闭";
                RegistFileHelper.WriteComputerInfoFile(encryptComputer);
                TryRunForm();
            }
        }
예제 #3
0
        /// <summary>
        /// 获取授权状态
        /// </summary>
        /// <returns></returns>
        private bool GetAuthState()
        {
            string authCode = registryHelper.GetRegistryData(Registry.LocalMachine, "SOFTWARE\\QQBatchSend.IR", "License");

            if (authCode != null && authCode != "")
            {
                RSACryption cryption = new RSACryption();
                string      regCode  = cryption.RSADecrypt(RSACryption.privateKey, authCode);
                if (regCode == ComputerInfo.GetComputerInfo())
                {
                    tsslAuthState.Text      = "已授权";
                    tsslAuthState.ForeColor = Color.Green;
                    return(true);
                }
            }
            tsslAuthState.Text      = "未授权";
            tsslAuthState.ForeColor = Color.Red;
            return(false);
        }
예제 #4
0
        //SkinEngine skinEngine;
        public FormMain()
        {
            InitializeComponent();
            Application.ThreadException       += Application_ThreadException;
            MoonLogger.Instance.FileName       = Application.StartupPath + "\\plugin\\" + "QQBatchSend.IR." + DateTime.Now.ToString("yyyyMMdd") + ".log";
            MoonLogger.Instance.OnWriteLog    += WriteLog;
            MoonLogger.Instance.OnWriteStatus += WriteStatus;
            tbRegCode.Text = ComputerInfo.GetComputerInfo();
            //读取授权信息
            string authCode = registryHelper.GetRegistryData(Registry.LocalMachine, "SOFTWARE\\QQBatchSend.IR", "License");

            if (authCode != null && authCode != "")
            {
                tbAuthCode.Text = authCode;
            }
            GetAuthState();
            ////初始化皮肤
            //skinEngine = new SkinEngine
            //{
            //    SkinFile = Application.StartupPath + "//Skins//DeepGreen.ssk"
            //};
        }
예제 #5
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            BindServiceQQ();
            tbRegCode.Text = ComputerInfo.GetComputerInfo();

            cbTemplateRule.SelectedIndex = 1;

            cbObjectType.SelectedIndexChanged -= cbList_SelectedIndexChanged;
            cbObjectType.SelectedIndex         = 0;
            cbObjectType.SelectedIndexChanged += cbList_SelectedIndexChanged;


            InitQQList();


            //手动触发一次
            cbList_SelectedIndexChanged(sender, e);

            if (File.Exists(messageTemplatePath))
            {
                DataGridViewHelper.ReadXml(dgvMessageTemplate, messageTemplatePath);
            }
        }
예제 #6
0
        /// <summary>
        /// Attempts to perform the registration of a new user.
        /// </summary>
        /// <param name="UserName">The user's username.</param>
        /// <param name="Password">The user's password.</param>
        /// <param name="Email">The user's email address.</param>
        /// <returns>Null if the operation succeeds, or a <see cref="SerializedException"/>
        /// encapsulating the error that occured if the operation fails.</returns>
        public SerializedException RegisterUser(string UserName, string Password, string Email)
        {
            SerializedException sx = null;

            try
            {
                //WebServiceProxy proxy = WebServiceProxy.Instance();
                int     ID       = 0;
                byte [] password = MD5Hash.md5(Password);
                sx = proxy.RegisterUser(ref ID, UserName, password, Email);
                if (sx != null)
                {
                    if (sx.Type == "CrawlWave.Common.CWUserExistsException")
                    {
                        log.LogWarning("User already exists, attempting to register client.");
                    }
                }
                globals.Settings.UserID   = ID;
                globals.Settings.UserName = UserName;
                globals.Settings.Password = password;
                globals.Settings.Email    = Email;
                CWComputerInfo info = ComputerInfo.GetComputerInfo();
                globals.Settings.HardwareInfo = ComputerInfo.GetSHA1HashCode(info);
                globals.Settings.SaveSettings();
                //proxy.ForceInitializeProxies();
                ClientInfo ci = new ClientInfo();
                ci.UserID = globals.Settings.UserID;
                sx        = proxy.RegisterClient(ref ci, info);
                globals.Settings.ClientID = ci.ClientID;
                globals.Settings.SaveSettings();
            }
            catch (Exception ex)
            {
                sx = new SerializedException(ex.GetType().ToString(), ex.Message, ex.StackTrace);
            }
            return(sx);
        }
예제 #7
0
 public FormMain()
 {
     InitializeComponent();
     tbRegCode.Text = ComputerInfo.GetComputerInfo();
 }