目录
-
using + namespace (命名空间)
相当于c++的头文件
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-
访问修饰符:指定类及其成员的访问规则(c++里面没有给访问修饰符的时候默认私有)
-
类的默认访问修饰符是:internal
-
成员的默认访问修饰符是:private(c++里面默认也是私有)
c#访问权限
-
public:公有的,能在任意程序集类中和类外访问
-
protected:受保护的,能在任意程序集的类中和子类中访问
-
private:私有的,只能在类中访问
-
internal:只能在当前程序集中的类中和类外访问
-
protected internal: == protected or internal :既可以在任意程序集中的类中和子类中访问,也可以在当前程序集中的类中和类外访问
程序集
-
程序集的数据可以分为:类型元数据