コード例 #1
0
        //下载更新列表
        private void DownLoad()
        {
            try
            {
                this.Invoke(ShowInfo, "正在下载更新列表...", false);
                this.Invoke(SetStatic, false);

                DataSet   ds    = MySqlHelper.ExecuteSQL(" select ver,url from cl_V_pda_ver a where type='ab' order by ver desc ");
                DataTable dtZXD = ds.Tables[0];

                string remoteVer = dtZXD.Rows[0]["ver"].ToString();
                string url       = dtZXD.Rows[0]["url"].ToString();
                if (remoteVer != LocalConfig.GetConfigValue("ver"))
                {
                    Process p = new Process();
                    p.StartInfo.FileName  = System.Windows.Forms.Application.StartupPath + "\\autoup.exe";
                    p.StartInfo.Arguments = remoteVer + " " + url + " " + System.Windows.Forms.Application.StartupPath + "\\plantodo.exe";
                    p.Start();

                    Process.GetCurrentProcess().Kill();
                }
                Invoke(new Action(() =>
                {
                    FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
                    loadpc.Visible  = false;
                }));
                this.Invoke(ShowInfo, "", false);
                this.Invoke(SetStatic, true);
            }
            catch (SystemException ex)
            {
                MessageShowSub(ex.Message, true);
            }
        }
コード例 #2
0
ファイル: PrintCore.cs プロジェクト: halfmoon2014/localtest
 // Token: 0x060000A7 RID: 167 RVA: 0x00006698 File Offset: 0x00004898
 public void Done(Print _print)
 {
     try {
         this.print = _print;
         this.print.setStatusCallback("下载中数据中...");
         string result = HttpWebRequestTools.PostFunctionjson(LocalConfig.GetConfigValue("gateway") + LocalConfig.GetConfigValue("labelListUrl"), "{\"djlx\":\"12610\",\"zt\":\"0\"}");
         Dictionary <string, object> dc = JsonConvert.DeserializeObject <Dictionary <string, object> >(result);
         bool flag = dc["errcode"].ToString() == "0";
         if (flag)
         {
             JArray        jArr           = ( JArray )dc["data"];
             List <string> printListGroup = new List <string>();
             List <object> idlist         = new List <object>();
             for (int i = 0; i < jArr.Count; i++)
             {
                 string spid      = jArr[i]["spid"].ToString().Trim();
                 string labelInfo = HttpWebRequestTools.PostFunctionjson(LocalConfig.GetConfigValue("gateway") + LocalConfig.GetConfigValue("labelInfoUrl"), "{\"spid\":\"" + spid + "\"}");
                 printListGroup.Add(labelInfo);
                 bool flag2 = (i + 1) % 6 == 0;
                 if (flag2)
                 {
                     this.PrintList.Add(printListGroup);
                     printListGroup = new List <string>();
                 }
                 Dictionary <string, int> idmap = new Dictionary <string, int>();
                 string id = jArr[i]["id"].ToString().Trim();
                 idmap.Add("id", int.Parse(id));
                 idlist.Add(idmap);
             }
             bool flag3 = jArr.Count < 6;
             if (flag3)
             {
                 this.PrintList.Add(printListGroup);
             }
             string idjsonstr = JsonConvert.SerializeObject(new Dictionary <string, object>
             {
                 {
                     "zdr",
                     "system"
                 },
                 {
                     "idList",
                     idlist
                 }
             });
             string upresult = HttpWebRequestTools.PostFunctionjson(LocalConfig.GetConfigValue("gateway") + LocalConfig.GetConfigValue("labelUpUrl"), idjsonstr);
             bool   flag4    = jArr.Count == 0;
             if (flag4)
             {
                 this.print.setStatusCallback("没有待打印数据...");
             }
             else
             {
                 this.DrawContent();
             }
         }
     } catch (Exception ex) {
     }
 }
コード例 #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            IPAddress ipAddr = Dns.Resolve(Dns.GetHostName()).AddressList[0];//获得当前IP地址
            //string ip = ipAddr.ToString();
            string name     = LocalConfig.GetConfigValue("name");
            string pwd      = LocalConfig.GetConfigValue("pwd");
            string username = LocalConfig.GetConfigValue("username");

            if (name.Length > 0 && pwd.Length > 0 && username.Length > 0)
            {
                Application.Run(new Plan(new DTO.LoginDto(name, pwd, username)));
            }
            else
            {
                Application.Run(new Login());
            }
        }