class object property method in .net

Posted by Shanky11 under C# on 1/29/2013 | Points: 10 | Views : 781 | Status : [Member] | Replies : 1
what is obj;ect class property method all these exactly are




Responses

Posted by: Rajesh081725 on: 1/30/2013 [Member] Bronze | Points: 25

Up
0
Down
Hi Shanky,
When You create a private variable at the time property method is used.
for example

private string _UserName;
private string _Password;
private string _FirstName;
private string _LastName;
private string _Email;
private string _Phoneno;
private string _Location;
private string _Created_By;
#endregion


/// <summary>
/// Gets or sets the <b>_UserName</b> attribute value.
/// </summary>
/// <value>The <b>_UserName</b> attribute value.</value>
public string UserName
{
get
{
return _UserName;
}
set
{
_UserName = value;
}
}

If u have to call a variable directly call using object
for example

class name object name=new class name//create object using class
object.privatevariable="assign values"


Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response