-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
77 lines (65 loc) · 2.47 KB
/
Program.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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text;
using System.Runtime.CompilerServices;
namespace TwitterSharp
{
public class GlobalVars
{
public static string PhoneNumber = "";
public static string TwitterHandle = "";
public static string RandoDingen = "Your Email password here";
public static int Provider = 0;
}
static class Program
{
static int StringToDigit(string StrDigit)
{
int IntDigit = 0;
switch (StrDigit)
{
case "0": IntDigit = 0; break;
case "1": IntDigit = 1; break;
case "2": IntDigit = 2; break;
case "3": IntDigit = 3; break;
};
return (IntDigit);
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//User chooses cellular provider from a dropdown menu.
//Have app run as server so that user can simply text the running app twitter handle parameters to change who they want to get text alerts about
//Save multiple user data, have them select their name from a dropdown menu, and autofill the text boxes accordingly
string PresetsPath = "UserAddresses.txt";
string UserPresets = "";
if (File.Exists(PresetsPath))
{
UserPresets = File.ReadAllText(PresetsPath);
if (UserPresets.Length > 5)
{
string[] UserDataChunks = UserPresets.Split(' ');
GlobalVars.TwitterHandle = UserDataChunks[0];
GlobalVars.PhoneNumber = UserDataChunks[1];
GlobalVars.Provider = StringToDigit(UserDataChunks[2]);
}
}
else
{
File.Create(PresetsPath);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new OpeningMenu());
UserPresets = GlobalVars.TwitterHandle + ' ' + GlobalVars.PhoneNumber + ' ' + GlobalVars.Provider;
File.WriteAllText(PresetsPath, UserPresets);
}
}
}