-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.cs
87 lines (75 loc) · 2.72 KB
/
Main.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
namespace RiftSharp_Launcher
{
public partial class Main
{
public Main()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
if (!File.Exists(Application.StartupPath + @"\WoWClient.exe"))
{
MessageBox.Show("Please copy the Launcher next to the 'WoWClient.exe'.");
return;
}
if (!string.IsNullOrEmpty(txtUserName.Text) && !string.IsNullOrEmpty(txtPassword.Text))
{
// Declare those variables!
string sFileName = Application.StartupPath + @"\wow.ses";
var myFileStream = new FileStream(sFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
// Create the stream writer.
var myWriter = new StreamWriter(myFileStream);
// Write in what is in the text box.
myWriter.Write(txtUserName.Text + "\r\n" + txtPassword.Text);
// Flush before we close.
myWriter.Flush();
// Close everything.
myWriter.Close();
myFileStream.Close();
var startInfo = new ProcessStartInfo(Application.StartupPath + @"\WoWClient.exe");
if (chkboxWindowed.Checked && !chkboxOpenGL.Checked)
{
startInfo.Arguments = "-uptodate -windowed";
}
else if (chkboxOpenGL.Checked && !chkboxWindowed.Checked)
{
startInfo.Arguments = "-opengl -uptodate";
}
else if (chkboxOpenGL.Checked && chkboxWindowed.Checked)
{
startInfo.Arguments = "-opengl -uptodate -windowed";
}
else
{
startInfo.Arguments = "-uptodate";
}
Process.Start(startInfo);
}
else
{
MessageBox.Show("Username and Password could not be empty.");
}
}
internal static class MainExe
{
// The main entry point for the application.
internal static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
private void chkboxOpenGL_CheckedChanged(object sender, EventArgs e)
{
}
private void chkboxWindowed_CheckedChanged(object sender, EventArgs e)
{
}
}
}