Пример #1
0
        private string getBalance()
        {
            string page = web.getDocument("http://portal.ecnu.edu.cn/eapdomain/neudcp/sso/sso_ecard_xxcx.jsp", Encoding.Default);

            string[] bal = HtmlParse.getBalance(page);
            return(bal[1]);
        }
Пример #2
0
        private void updateBalanceRecord()
        {
            string page = web.getDocument("http://portal.ecnu.edu.cn/eapdomain/neudcp/sso/sso_ecard_xxcx.jsp", Encoding.Default);

            string[] bal = HtmlParse.getBalance(page);
            Dispatcher.Invoke((Action) delegate
            {
                balanceLbl.Content = bal[1];
                statusLbl.Content  = bal[0];
            });

            page = web.getDocument("http://www.ecard.ecnu.edu.cn/Ecard/cqmoney.aspx", Encoding.Default);
            string[] consume = HtmlParse.getConsume(page);
            Dispatcher.Invoke((Action) delegate
            {
                recordProcessLbl.Content = "[正在获取中...]";
            });
            Dispatcher.Invoke((Action) delegate
            {
                costGrid.Children.RemoveRange(6, costGrid.Children.Count - 6);
                for (int i = 0; i < consume.Length; i++)
                {
                    string[] cur = consume[i].Split(' ');
                    costGrid.RowDefinitions.Add(new RowDefinition());
                    for (int j = 0; j < 6; j++)
                    {
                        Label lbl    = new Label();
                        lbl.FontSize = 16;
                        lbl.Content  = cur[j];
                        costGrid.Children.Add(lbl);
                        Grid.SetRow(lbl, i + 1);
                        Grid.SetColumn(lbl, j);
                    }
                }
                recordProcessLbl.Content = "";
            });
        }