Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                ExhausitiverConfig config = parseConfig();

                String json = JsonHandle.toJson(config);
                json = JsonHandle.JsonTree(json);
                String     fileName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".conf";
                FileStream fs       = new FileStream(fileName, FileMode.Create);
                byte[]     data     = System.Text.Encoding.Default.GetBytes(json);
                fs.Write(data, 0, data.Length);
                fs.Flush();
                fs.Close();
                MessageBox.Show("保存成功(" + fileName + ")");
            }
            catch { }
        }