今天学习,如标题。创建一个类,字段属性构造函数:Source code:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading ...
今天学习,如标题。创建一个类,字段属性构造函数:Source code:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Insus.NET.Models{ public class Customer { public int CustomerID { get; set; } public string CustomerName { get; set; } public string PID { get; set; } public Customer() { } public Customer(int customerId, string customerName, string pID) { CustomerID = customerId; CustomerName = customerName; PID = pID; } }}
public Customer[] ArrayCustoners() { Customer c1 = new Customer(); c1.CustomerID = 9; c1.CustomerName = "张三"; c1.PID = "123456789012"; Customer c2 = new Customer(10, "李四", "321245677812"); Customer c3 = new Customer() { CustomerID = 30, CustomerName = "吴广", PID = "213445678912" }; return new Customer[] { c1,c2,c3 }; }
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:C#的类,构造函数以及Array阵列的数据填充与绑定
关键词:C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。