-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharForm.cs
47 lines (43 loc) · 1.11 KB
/
CharForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace osu2ass
{
public partial class CharForm : Form
{
public CharForm()
{
InitializeComponent();
}
public static readonly string CharPath = $"{new FileInfo(Application.ExecutablePath).DirectoryName}\\char.txt";
protected override void OnLoad(EventArgs e)
{
try
{
if (File.Exists(CharPath)) textBox1.Text = File.ReadAllText(CharPath);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void CharForm_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
File.WriteAllText(CharPath, textBox1.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}