The other answers given already have your answer, so I won't beat a dead horse here. You need to declare the field public
in order to be able to access it from external code.
In C++, structs and classes are equivalent, with the only difference being the default access level of their respective members.
However, that's not the case in C#. Generally, you should only use a struct for small, short-lived objects that are immutable (won't change). A structure has value type semantics, where as a class has reference type semantics. It's very important that you understand the difference between value types and reference types if you're learning to program in C#. Jon Skeet has published an article that attempts to provide that explanation. But you'll definitely want to pick up a good introductory book to C# that treats these issues in more detail.
More often than not, you'll want to use a class in C#, rather than a structure. And when you use that class, note that Microsoft's design guidelines for C# tend to recommend against exposing public fields. Instead, they recommend that you use a public property, backed by a private field. A more thorough exposition of the rationale behind that guideline is given here. For example:
class TimePeriod
{
private double seconds;
public double Seconds
{
get { return seconds; }
set { seconds = value; }
}
}
Or you can use the simpler "automatic properties" syntax, which has the compiler automatically generate that private backing field:
class TimePeriod
{
public double Seconds { get; set; }
}