public static void CreateFile(string path) { // Create directory for store default user path (If it doesn't exists, no problem). Directory.CreateDirectory(defaultUserPath); // First, clean all the .txt content. File.WriteAllText(defaultUserPath + @"\DefaultPath.txt", Prints.Blank()); // After that, add the user path. File.AppendAllText(defaultUserPath + @"\DefaultPath.txt", path); }
static void Main(string[] args) { while (true) { Console.WriteLine(Prints.Blank()); Console.WriteLine(Prints.WelcomeMessage()); Console.WriteLine(Prints.WelcomeMessageHelp()); Console.WriteLine(Prints.Blank()); Console.Write(Prints.Arrow()); string userInput = Console.ReadLine(); UserCommands.ReturnUserCommandInformation(userInput); } }
public static void HelpManual() { string manualTitle = " Here is your 'help' manual!"; string download = " {https://youtube/url} ------- for start download."; string url = " 1 - Video/Audio ------- select for download video and audio."; string type = " 2 - Image ------- select for download an image."; string folder = " folder ------- the folder path."; string setPath = " --set-path ------- for start a new default folder path location."; string path = " path ------- the name of the default path."; string hint = " hint ------- use '.' for use default properties."; Console.ForegroundColor = ConsoleColor.DarkMagenta; Console.WriteLine(manualTitle); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(download); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(url); Console.WriteLine(type); Console.WriteLine(folder); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(setPath); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(path); Console.ResetColor(); Console.WriteLine(Prints.Blank()); Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine(hint); Console.ResetColor(); }
public static void SetURLPath() { userChoice: Console.WriteLine(Prints.Blank()); Console.Write(Strings.PATH + " " + Prints.Arrow()); string path = Console.ReadLine(); if (!Validator.IsValidDefaultPathRequest(path)) { Prints.InvalidDefaultPath(); goto userChoice; } DefaultFolder.CreateFile(path); Prints.Done(); }