What is the purpose of the “get” and “set” properties in C#

前端 未结 7 1600
鱼传尺愫
鱼传尺愫 2020-12-30 12:35

I saw some get set method to set values. Can anyone tell me the purpose of this?

public string HTTP_USER_NAME
{
      get 
      {
            return UserNam         


        
7条回答
  •  抹茶落季
    2020-12-30 12:56

    Standard way to implement properties in C#. UserName and UserPwd are private member variables (string type) of the class where these 2 methods are defined.

提交回复
热议问题