Example #1
0
        public MainWindow(IPersonAppService personAppService)
        {
            //_personAppService = personAppService;
            InitializeComponent();

            timer.Tick    += Timer_Tick;
            timer.Interval = 8000;

            dpicker.SelectedDate = DateTime.Now;

            //read parameter
            StringBuilder param = new StringBuilder(99);

            IniHelper.GetPrivateProfileString("main", "url", "", param, 199, IniHelper.strFilePath);
            txtUrl.Text = param.ToString();
            param.Clear();
            IniHelper.GetPrivateProfileString("main", "cookie", "", param, 199, IniHelper.strFilePath);
            txtCookie.Text = param.ToString();

            //设置IE版本
            IEVersion.BrowserEmulationSet();

            web.ScriptErrorsSuppressed = true;
            host.Child = web;
            grid.Children.Add(host);

            host.SetValue(Grid.RowProperty, 1);
            host.SetValue(Grid.ColumnProperty, 2);

            InitialTray();
            Title += "----:" + Thread.CurrentThread.ManagedThreadId;
        }
Example #2
0
        private void btnGo_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtUrl.Text))
            {
                return;
            }

            //保存参数
            IniHelper.WritePrivateProfileString("main", "url", txtUrl.Text, IniHelper.strFilePath);
            IniHelper.WritePrivateProfileString("main", "cookie", txtCookie.Text, IniHelper.strFilePath);

            //cookie process
            //[email protected]; ASP.NET_SessionId=arivphmjtn1slizruugty0jz; 5411=3BC71FAEBE42E1639EB6FDED38D714CD
            Dictionary <string, string> cookies = ResolveCooke(txtCookie.Text);

            if (cookies.Count < 1)
            {
                return;
            }
            //设置cookie
            foreach (var item in cookies)
            {
                InternetSetCookie(txtUrl.Text, item.Key, item.Value);
            }

            Match match = Regex.Match(txtUrl.Text.TrimEnd(), "\\d+$");

            webid = match.Value;



            if (!string.IsNullOrEmpty(webid))
            {
                //url_list = "http://ehr.litsoft.com.cn/scripts/mgrqispi.dll?appname=HRsoft2000&prgname=ATT_DETAIL_STF&arguments=-AS" + webid;
                //Url_req = "http://ehr.litsoft.com.cn/scripts/mgrqispi.dll?Appname=HRsoft2000&Prgname=ATT_MAKEUP_REC&ARGUMENTS=-AS"+webid+",-A";
                //url_req_query = "http://ehr.litsoft.com.cn/scripts/mgrqispi.dll?appname=hrsoft2000&prgname=ATT_MAKEUP_REC_QUERY&arguments=-AS"+webid;
            }
            url_list      = "http://kaoqin.litsoft.com.cn/index.htm";
            Url_req       = "http://kaoqin.litsoft.com.cn/WebForms/ApplyForManage.aspx?otype=C";
            url_req_query = "http://kaoqin.litsoft.com.cn/WebForms/ApplyforList.aspx";

            web.Navigate(txtUrl.Text);
            web.DocumentCompleted += Web_DocumentCompleted3;
        }