If I create a new Class, and in this class I put a property like so:
public class CurrentDirectory
{
private string cd;
public string CurrentDirectory
{
get
{
return cd;
}
set
{
cd = value;
}
}
I then, at one point in my program, create a new instance of this class like so:
CurrentDirectory myCurrentDirectory = New CurrentDirectory();
I then set a value to CurrentDirectory like so:
myCurrentDirectory.CurrentDirectory = @"C:\MyFiles\Here";
Then, at another point in my program I create another instance of CurrentDirectory and 'get' the value of CurrentDirectory like so:
CurrentDirectory myCurrentDirectory1 = new CurrentDirectory();
string putFilesHere = myCurrentDirectory1.CurrentDirectory;
Will this return the value I set earlier or do I need to 'get' and 'set' my value within the same instance?
Thanks