public class class1 { ... public string UserName { get; set; } ... }
class1 oc1 = new class1(); oc1.UserName = "Jone"; ... Console.WriteLine(oc1.UserName);
public class Global { public static int global_var1 = 3; public static int global_var2 = 5; } //Now in order to access global_var from anywhere in your program, use the following syntax: int local_var1 = 0; local_var1 = Global.global_var1;
public class Class1 { public string _CustomerName = "Jone"; public string CustomerName { get { return _CustomerName; } set { _CustomerName = value; } } }
public class Class2 { Class1 cls1=new Class1(); string CustomerName= cls1.CustomerName; Document.Write(CustomerName); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)