I've recently written this short application in C#:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Checker { class Program { static void Main(string[] args) { Properties.Settings.Default.Save(); Program re = new Program(); re.next(); } public void next() { Console.WriteLine("Have you already entered name?"); int ch = int.Parse(Console.ReadLine()); if (ch == 0) { Console.WriteLine("What is your name?"); String name = Console.ReadLine(); Console.WriteLine("Thank you!"); Console.ReadKey(); } Console.WriteLine("Your name is " + name); } } } Now, I've created a settings file, and created a "name" variable there, with the "String" type.
The scope of it is "User".
So I want it to load the "name" variable with the properties line, but I can't even compile the program because of this error:
Error 1 The name 'name' does not exist in the current context How can I solve it?
Properties.Settingshas to do with your current code ?