Пример #1
0
        // 주소 클릭시 이벤트 함수
        void addressItem_Click(object sender, EventArgs e)
        {
            ToolStripItem clickedItem = sender as ToolStripItem;
            AddressLine   tmpAL       = (AddressLine)clickedItem.Tag;

            currentSelectedIndex = tmpAL.IndexNo;

            // 수집 주소
            labelAddr.Text = tmpAL.Address;

            // 수집 간격 옵션
            labelCrawlTerm.Text = "수집간격 - " + UtilManager.ConvertCrawlTerm(tmpAL.CrawlTerm);

            // 수집 상태
            if ("R" == tmpAL.CrawlStatus)
            {
                labelRunStatus.Text = Fonts.fa.recycle + "  " + UtilManager.ConvertCrawlStatus(tmpAL.CrawlStatus);
            }
            else
            {
                labelRunStatus.Text = Fonts.fa.hand_stop_o + "  " + UtilManager.ConvertCrawlStatus(tmpAL.CrawlStatus);
            }

            currentSelectedRunStatus = tmpAL.CrawlStatus;

            // 로그
            loManagerForAddress.StopOutput();
            loManagerForAddress = new LogOutputManager(tmpAL.IndexNo, textBoxPrivateLog);
        }
Пример #2
0
        public void ReadAddress()
        {
            /*
             * if(0 < Addresses.Count)
             * {
             *  Addresses.Clear();
             * }
             */

            // StreamReader sr = new StreamReader(new FileStream(FwjIni, FileMode.OpenOrCreate));
            StreamReader sr       = new StreamReader(FwjIni, System.Text.Encoding.Default, true);
            long         fileSize = sr.BaseStream.Length;

            sr.Close();

            if (0 == fileSize)
            {
                MessageBox.Show("영농일지 주소 정보가 없습니다4");
            }
            else
            {
                // sr = new StreamReader(new FileStream(FwjIni, FileMode.OpenOrCreate));
                sr = new StreamReader(FwjIni, System.Text.Encoding.Default, true);
                string readLine = sr.ReadLine();        // DB 접속정보 읽기

                if (null == (readLine = sr.ReadLine())) // 주소정보 읽기 시작
                {
                    MessageBox.Show("영농일지 주소 정보가 없습니다5");
                }
                else
                {
                    while (null != readLine && "" != readLine)     // 주소정보 읽기 시작
                    {
                        string[]    addressInfo = readLine.Split('|');
                        AddressLine tmpAL       = new AddressLine();
                        tmpAL.IndexNo     = addressInfo[0];
                        tmpAL.Address     = addressInfo[1];
                        tmpAL.Nx          = addressInfo[2];
                        tmpAL.Ny          = addressInfo[3];
                        tmpAL.CrawlTerm   = addressInfo[4];
                        tmpAL.CrawlStatus = addressInfo[5];
                        Addresses.Add(tmpAL);
                        readLine = sr.ReadLine();
                    }
                }
                sr.Close();
            }
        }
Пример #3
0
        public void ReadAddress()
        {
            StreamReader sr       = new StreamReader(new FileStream(AddressIni, FileMode.OpenOrCreate));
            long         fileSize = sr.BaseStream.Length;

            sr.Close();

            if (0 == fileSize)
            {
                // MessageBox.Show("address.ini의 주소 정보가 없습니다-2");
            }
            else
            {
                sr = new StreamReader(AddressIni, System.Text.Encoding.Default, true);
                string readLine = null;

                if (null == (readLine = sr.ReadLine()))     // 주소정보 읽기 시작
                {
                    MessageBox.Show("address.ini의 주소 정보가 없습니다-3");
                }
                else
                {
                    while (null != readLine)     // 주소정보 읽기 시작
                    {
                        string[]    addressInfo = readLine.Split('|');
                        AddressLine tmpAL       = new AddressLine();
                        tmpAL.IndexNo     = addressInfo[0];
                        tmpAL.Address     = addressInfo[1];
                        tmpAL.Nx          = addressInfo[2];
                        tmpAL.Ny          = addressInfo[3];
                        tmpAL.CrawlTerm   = addressInfo[4];
                        tmpAL.CrawlStatus = addressInfo[5];
                        Addresses.Add(tmpAL);
                        readLine = sr.ReadLine();
                    }
                }
                sr.Close();
            }
        }