-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSPSelect.cs
More file actions
72 lines (69 loc) · 1.77 KB
/
SPSelect.cs
File metadata and controls
72 lines (69 loc) · 1.77 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Instant_Doom
{
public partial class SPSelect : Form
{
public SPSelect()
{
InitializeComponent();
KeyPreview = true;
try
{
StreamReader IniFile = new StreamReader(".\\SourcePort.ini");
IniFile.Close();
}
catch
{
StreamWriter IniFileW = new StreamWriter(".\\SourcePort.ini");
IniFileW.WriteLine(".\\chocolate-doom.exe");
IniFileW.Close();
}
StreamReader IniFileR = new StreamReader(".\\SourcePort.ini");
try
{
SourceBox.Text = IniFileR.ReadLine();
}
catch
{
SourceBox.Text = ".\\chocolate-doom.exe";
}
finally
{
IniFileR.Close();
}
}
private void Button1_Click(object sender, EventArgs e)
{
StreamWriter IniFile = new StreamWriter(".\\SourcePort.ini");
try
{
IniFile.WriteLine(SourceBox.Text);
}
catch
{
IniFile.WriteLine(".\\chocolate-doom.exe");
}
finally
{
IniFile.Close();
Close();
}
}
private void SPSelect_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
Close();
}
}
}
}