Hello i want to retrieve user inputed variable from this method: they are all string and has been declared globally.
public void DetailsMovie()
{
Console.WriteLine("\n \v Enter the movie title");
MovieTitle = Console.ReadLine();
Console.WriteLine("\n Enter the year it was released");
MovieYear = Console.ReadLine();
Console.WriteLine("\n Enter the name of the movie's publisher");
MoviePublisher = Console.ReadLine();
Console.WriteLine("\n What is the length of the movie (in hours)");
MovieLength = Console.ReadLine();
}
public void SaveData()
{
Console.Write("Enter filename");
string Filename = Console.ReadLine();
if (File.Exists(Filename))
{
StreamWriter file = new StreamWriter(Filename, true);
file.WriteLine("", MovieTitle);
file.WriteLine("",MovieYear);
file.WriteLine("",MoviePublisher);
file.WriteLine("",MovieLength);
}
else
{
StreamWriter file = new StreamWriter(Filename + ".txt");
file.Write(String.Format("",MovieTitle));
file.Write(String.Format("",MovieYear));
file.Write(String.Format("",MoviePublisher));
file.Write(String.Format("",MovieLength));
file.Close();
Console.Write(" saved successful");
}
}