using System.Collections.Generic;
using System.Threading.Tasks;
public static void MenyVal()
Console.Write("Choose in the menue: \n");
Console.WriteLine("----------------------------------");
Console.WriteLine("[1]Write a new post.");
Console.WriteLine("[2]Search for a post.");
Console.WriteLine("[3]Show all your posts.");
Console.WriteLine("[4]Empty your log.");
Console.WriteLine("[5]Exit.");
Console.WriteLine("----------------------------------");
Console.Write("Choice: ");
static void Main(string[] args)
List<string> Loggboken = new List<string>();
string[] Index = new string[Plats];
string str = Console.ReadLine();
int menyVal = Convert.ToInt32(str);
Console.WriteLine("-----------------");
Console.WriteLine("Write your title: ");
Console.WriteLine("-----------------");
Index[0] = Console.ReadLine();
Console.WriteLine("----------------");
Console.WriteLine("Write your post: ");
Console.WriteLine("----------------");
Index[1] = Console.ReadLine();
Console.WriteLine("Do you want to save your post?");
string answer = Console.ReadLine();
if (answer == "yes" || answer == "Yes")
Console.WriteLine("Your post has been saved");
Console.WriteLine("-------------------------------");
Console.WriteLine("Type in what you're looking for: ");
Console.WriteLine("-------------------------------\n");
sokning = Console.ReadLine();
foreach (string item in Loggboken)
if (item.ToUpper() == sokning.ToUpper())
Console.WriteLine("You found: " + item + Index[1] + ", in your log.");
Console.WriteLine("--------------");
Console.WriteLine("All your logs:");
Console.WriteLine("--------------");
foreach (string item in Loggboken)
Console.WriteLine(item + ("\n"));
Console.WriteLine("---------------------------");
Console.WriteLine("You've emptied your logbook");
Console.WriteLine("---------------------------\n");
Console.WriteLine("*---------------------------*");
Console.WriteLine(" Logbook is now closing...");
Console.WriteLine("*---------------------------*");
System.Threading.Thread.Sleep(1200);
Console.WriteLine("----------------------------------");
Console.WriteLine("*** Type a number in the menu. ***");
Console.WriteLine("----------------------------------");