示例#1
0
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Hide();
     new FirstBoot().ShowDialog();
     config            = JObject.Parse(File.ReadAllText("config.json")).ToObject <GamePickerConfig>();
     steamidInput.Text = config.UserId.ToString();
     this.Show();
 }
示例#2
0
 public SteamGamePicker()
 {
     // We're checking config before the form loads ;)
     // Preload Config
     if (!File.Exists("config.json"))
     {
         new FirstBoot().ShowDialog();
     }
     config = JObject.Parse(File.ReadAllText("config.json")).ToObject <GamePickerConfig>();
     File.Create("game.txt").Close();
     InitializeComponent();
 }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            File.Create("config.json").Close();
            GamePickerConfig cfg = new GamePickerConfig();

            cfg.ApiKey = textBox1.Text;
            try
            {
                cfg.UserId = ulong.Parse(textBox2.Text);
            }catch (Exception)
            {
                MessageBox.Show("Failed topare your ID! please make sure it is a valid Steam ID64 (ulong)");
                return;
            }
            File.WriteAllText("config.json", JObject.FromObject(cfg).ToString());
            this.Close();
        }