Files

52 lines
1.5 KiB
C#

using SkinSE;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UFIDA.U8.Framework.Api.App
{
public partial class ApiConfig : Form
{
public ApiConfig()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//ConfigurationManager.AppSettings["ServerAddress"] = textBox1.Text;
//ConfigurationManager.AppSettings["ServerPath"] = textBox2.Text;
var config= ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["ServerAddress"].Value = textBox1.Text;
config.AppSettings.Settings["ServerPath"].Value = textBox2.Text;
config.Save();
ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.SectionName);
DialogResult = DialogResult.OK;
}
private void ApiConfig_Load(object sender, EventArgs e)
{
var skin = new SkinSE_Net();
skin.Init_NET(this, 1);
var serverAddress = ConfigurationManager.AppSettings["ServerAddress"];
var serverPath = ConfigurationManager.AppSettings["ServerPath"];
textBox1.Text= serverAddress;
textBox2.Text= serverPath;
}
}
}