Пример #1
0
        private void TestConfigForm_Load(object sender, EventArgs e)
        {
            StartForm sf = new StartForm();

            sf.ShowDialog();

            if (!File.Exists(con_file_path))
            {
                File.Create(con_file_path);
            }
            using (StreamReader sr = new StreamReader(con_file_path))
            {
                try
                {
                    string sconfig = sr.ReadToEnd();
                    Dictionary <string, object> dic = JsonHelper.DeserializeJsonToObject <Dictionary <string, object> >(sconfig);
                    if (dic != null)
                    {
                        cbEncoding.SelectedItem         = dic["Encoding"];
                        txbMacQRcode.Text               = dic["MaxQR"].ToString();
                        tbBackUrl.Text                  = dic["BackUrl"].ToString();
                        txbUnqiueNumber.Text            = dic["ReqReserved"].ToString();
                        tbQRAPPIP.Text                  = dic["PhoneIp"].ToString();
                        tbQRPlatformUrl.Text            = dic["PlatformUrl"].ToString();
                        cbDeviceTypeSelect.SelectedItem = dic["DeviceType"].ToString();
                    }
                }
                catch (Exception ex)
                {
                    MetroMessageBox.Show(this, ex.Message);
                }
            }
        }
Пример #2
0
        public static void Main()
        {
            StartForm startForm = new StartForm();

            startForm.ShowDialog();
        }