Example #1
0
        private void SelectBank_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ExchangeRateTab.SelectedTab.Name.Equals("TodayRatePage"))
            {
                switch (SelectBank.SelectedItem)
                {
                case "신한은행":
                    BankPicture.Url = new Uri("https://ssl.pstatic.net/sstatic/keypage/outside/scui/foreigninfo/img/img_shinhan.png");
                    RateGrahp.Url   = new Uri("http://imgfinance.naver.net/chart/marketindex/area/month3/FX_USDKRW.png");
                    Untill.UpdateData(Bank.Sinhan);
                    display();
                    break;

                case "KBH 하나은행":
                    BankPicture.Url = new Uri("https://ssl.pstatic.net/sstatic/keypage/outside/scui/foreigninfo/img/img_hana.png");
                    RateGrahp.Url   = new Uri("http://imgfinance.naver.net/chart/marketindex/area/month3/FX_USDKRW_SHB.png");
                    Untill.UpdateData(Bank.KBH);
                    display();
                    break;
                }
            }
            else if (ExchangeRateTab.SelectedTab.Name.Equals("SearchLastRate"))
            {
                switch (SelectBank.SelectedItem)
                {
                case "신한은행":
                    LastRate.Url = new Uri("http://info.finance.naver.com/marketindex/exchangeDailyQuote.nhn?marketindexCd=FX_USDKRW_SHB&page=" + RateSearch.Value + "");
                    break;

                case "KBH 하나은행":
                    LastRate.Url = new Uri("http://info.finance.naver.com/marketindex/exchangeDailyQuote.nhn?marketindexCd=FX_USDKRW&page=" + RateSearch.Value + "");
                    break;
                }
            }
        }
Example #2
0
 public Form1()
 {
     InitializeComponent();
     this.MouseWheel         += new MouseEventHandler(RateSearch_Wheel);
     SelectBank.SelectedIndex = 0;
     Untill.UpdateData(Bank.KBH);
     display();
     using (WebClient Web = new WebClient())
     {
         String   source    = Web.DownloadString(@"http://info.finance.naver.com/marketindex/exchangeDailyQuote.nhn?marketindexCd=FX_USDKRW&page=100000");
         String[] delimiter = { "<a href=\"/marketindex/exchangeDailyQuote.nhn?marketindexCd=FX_USDKRW&page=" };
         String[] str       = source.Split(delimiter, StringSplitOptions.None);
         String   Last      = str[str.Length - 1];
         RateSearch.Minimum = 1;
         RateSearch.Maximum = Convert.ToInt32(Last.Split('\"')[0]);
     }
 }