Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Reflection;
- using System.Text;
- namespace DiscordGameChanger
- {
- class Program
- {
- static void Main()
- {
- string filename = "settings.txt";
- checkFileExists(filename);
- getTitle(filename);
- }
- private static void checkFileExists(string filename)
- {
- if (!File.Exists(filename))
- {
- using (TextWriter TW = new StreamWriter(filename))
- {
- TW.WriteLine("Your Title Here");
- }
- }
- }
- private static void getTitle(string filename)
- {
- using (TextReader TR = new StreamReader(filename))
- {
- Console.Title = TR.ReadLine();
- Console.WriteLine("Set title to: " + Console.Title);
- }
- setTitle(filename);
- }
- private static void setTitle(string filename)
- {
- Console.WriteLine("Please input you desired title:");
- string newFN = Console.ReadLine();
- using (TextWriter TW = new StreamWriter(filename))
- {
- TW.WriteLine(newFN);
- }
- Restart();
- }
- private static void Restart()
- {
- Process.Start(Assembly.GetExecutingAssembly().Location);
- Environment.Exit(0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement