示例#1
0
    public bool LoadIni(string inifilepath)
    {
        bool bResult = true;

        try
        {
            INIControlor ic = new INIControlor(inifilepath);

            dbip_        = ic.GetIniValue2("Database", "ip");
            dbport_      = ic.GetIniValue2("Database", "port");
            dbname_      = ic.GetIniValue2("Database", "name");
            dbaccount_   = ic.GetIniValue2("Database", "account");
            dbpw_        = ic.GetIniValue2("Database", "pw");
            method_      = ic.GetIniValue2("Database", "method");
            sshhostname_ = ic.GetIniValue2("Database", "sshhostname");
            sshuser_     = ic.GetIniValue2("Database", "sshuser");
            sshpw_       = ic.GetIniValue2("Database", "sshpw");

            string tempstring = ic.GetIniValue2("ETC", "refreshtick");
            refreshtick_ = Convert.ToInt32(tempstring);

            tempstring = ic.GetIniValue2("ETC", "checkbox");
            checkbox_  = Convert.ToInt32(tempstring);
            loginid_   = ic.GetIniValue2("ETC", "loginid");

            bLoad_ = true;
        }
        catch
        {
            bResult = false;
            bLoad_  = false;
        }

        return(bResult);
    }
示例#2
0
        public bool LoadIni(string inifilepath)
        {
            bool bResult = true;

            try
            {
                INIControlor ic         = new INIControlor(inifilepath);
                string       tempstring = ic.GetIniValue2("Crawler", "uid");
                UID_ = Convert.ToInt32(tempstring);

                tempstring = ic.GetIniValue2("Crawler", "mode");
                MODE_      = Convert.ToInt32(tempstring);
                if (MODE_ < 0 || MODE_ > 3)
                {
                    MODE_ = 0;
                    return(false);
                }

                dbip_        = ic.GetIniValue2("Database", "ip");
                dbport_      = ic.GetIniValue2("Database", "port");
                dbname_      = ic.GetIniValue2("Database", "name");
                dbaccount_   = ic.GetIniValue2("Database", "account");
                dbpw_        = ic.GetIniValue2("Database", "pw");
                method_      = ic.GetIniValue2("Database", "method");
                sshhostname_ = ic.GetIniValue2("Database", "sshhostname");
                sshuser_     = ic.GetIniValue2("Database", "sshuser");
                sshpw_       = ic.GetIniValue2("Database", "sshpw");

                managerip_   = ic.GetIniValue2("Manager", "ip");
                tempstring   = ic.GetIniValue2("Manager", "port");
                managerport_ = Convert.ToInt32(tempstring);

                tempstring  = ic.GetIniValue2("ETC", "partneridx");
                partneridx_ = Convert.ToInt32(tempstring);

                tempstring  = ic.GetIniValue2("ETC", "channelidx");
                channelidx_ = Convert.ToInt32(tempstring);

                tempstring  = ic.GetIniValue2("ETC", "channelseq");
                channelseq_ = Convert.ToInt32(tempstring);

                tempstring    = ic.GetIniValue2("ETC", "authorityseq");
                authorityseq_ = Convert.ToInt32(tempstring);

                tempstring    = ic.GetIniValue2("ETC", "crawlingtick");
                crawlingtick_ = Convert.ToInt32(tempstring);

                tempstring      = ic.GetIniValue2("ETC", "deletedownfile");
                deletedownfile_ = Convert.ToBoolean(tempstring);

                tempstring   = ic.GetIniValue2("CHECKER", "checkerport");
                checkerport_ = Convert.ToInt32(tempstring);
            }
            catch
            {
                bResult = false;
            }

            return(bResult);
        }
示例#3
0
        public bool UpdateMonitorSeq(string inifilepath, Int32 MonitorSeq)
        {
            try
            {
                INIControlor ic = new INIControlor(inifilepath);
                ic.SetIniValue("Checker", "MonitorSeq", MonitorSeq.ToString());
                MonitorSeq_ = MonitorSeq;
            }
            catch
            {
                return(false);
            }

            return(true);
        }
示例#4
0
    public bool SaveCheckBoxAndID(string inifilepath, string ischeckbox, string loginid)
    {
        try
        {
            INIControlor ic = new INIControlor(inifilepath);

            ic.SetIniValue("ETC", "checkbox", ischeckbox);
            ic.SetIniValue("ETC", "loginid", loginid);

            checkbox_ = Convert.ToInt32(ischeckbox);
            loginid_  = loginid;
        }
        catch
        {
            return(false);
        }

        return(true);
    }
示例#5
0
        public bool LoadIni(string inifilepath)
        {
            bool bResult = true;

            try
            {
                INIControlor ic = new INIControlor(inifilepath);

                dbip_        = ic.GetIniValue2("Database", "ip");
                dbport_      = ic.GetIniValue2("Database", "port");
                dbname_      = ic.GetIniValue2("Database", "name");
                dbaccount_   = ic.GetIniValue2("Database", "account");
                dbpw_        = ic.GetIniValue2("Database", "pw");
                method_      = ic.GetIniValue2("Database", "method");
                sshhostname_ = ic.GetIniValue2("Database", "sshhostname");
                sshuser_     = ic.GetIniValue2("Database", "sshuser");
                sshpw_       = ic.GetIniValue2("Database", "sshpw");

                string tempstring = ic.GetIniValue2("Checker", "MonitorSeq");
                MonitorSeq_ = Convert.ToInt32(tempstring);

                tempstring = ic.GetIniValue2("Checker", "CheckTime");
                CheckTime_ = Convert.ToInt32(tempstring);

                tempstring       = ic.GetIniValue2("Checker", "WaitCrawlerTime");
                WaitCrawlerTime_ = Convert.ToInt32(tempstring);

                tempstring         = ic.GetIniValue2("Checker", "ListenCrawlerPort");
                ListenCrawlerPort_ = Convert.ToInt32(tempstring);

                ExePath_ = ic.GetIniValue2("Checker", "exefullpath");

                bLoad_ = true;
            }
            catch
            {
                bResult = false;
                bLoad_  = false;
            }

            return(bResult);
        }
示例#6
0
        public bool UpdateCrawlerINI(string inifilepath, Int32 Auth, Int32 ChannelSeq, Int32 CrawlerSeq
                                     , Int32 mode)
        {
            try
            {
                INIControlor ic = new INIControlor(inifilepath);

                bUpdate_ = ic.SetIniValue("ETC", "authorityseq", Auth.ToString());
                bUpdate_ = ic.SetIniValue("Crawler", "uid", CrawlerSeq.ToString());
                bUpdate_ = ic.SetIniValue("ETC", "channelseq", ChannelSeq.ToString());
                bUpdate_ = ic.SetIniValue("ETC", "channelidx", ChannelSeq.ToString());
                bUpdate_ = ic.SetIniValue("Crawler", "mode", mode.ToString());
            }
            catch
            {
                bUpdate_ = false;
                return(false);
            }

            bUpdate_ = true;

            return(true);
        }
示例#7
0
        private bool InitIni()
        {
            try
            {
                string       inifilepath = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory() + "/LQCrawlerChecker.INI";
                INIControlor ic          = new INIControlor(inifilepath);
                ProcessName_ = ic.GetIniValue2("Checker", "processname");
                ExePath_     = ic.GetIniValue2("Checker", "exefullpath");
                string tempstr = ic.GetIniValue2("Checker", "CheckTime");
                CheckTime_   = Convert.ToInt32(tempstr);
                tempstr      = ic.GetIniValue2("Checker", "crawleridx");
                crawleridx_  = Convert.ToInt32(tempstr);
                tempstr      = ic.GetIniValue2("Checker", "channelidx");
                nchannelidx_ = Convert.ToInt32(tempstr);

                tempstr            = ic.GetIniValue2("Checker", "ListenCrawlerPort");
                ListenCrawlerPort_ = Convert.ToInt32(tempstr);

                tempstr          = ic.GetIniValue2("Checker", "WaitCrawlerTime");
                WaitCrawlerTime_ = Convert.ToInt32(tempstr);

                // 매니저쪽 정보 로드
                manager_ip_   = ic.GetIniValue2("Manager", "ip");
                tempstr       = ic.GetIniValue2("Manager", "port");
                manager_port_ = Convert.ToInt32(tempstr);

                bLoaded_ = true;
                return(true);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
                bLoaded_ = false;
                return(false);
            }
        }