上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页
摘要: using Microsoft.AspNetCore.Mvc.Filters; using System; using System.Threading.Tasks; namespace dotnet_core.Filter { public class MyFilterAttribute: ActionFilterAttribute { public over... 阅读全文
posted @ 2019-09-22 17:07 liliyou 阅读(506) 评论(0) 推荐(0)
摘要: C#对类的解构,必须在该类内实现Deconstruct方法,并且返回类型为void ,并用out参数返回各个部分。 阅读全文
posted @ 2019-09-13 14:57 liliyou 阅读(274) 评论(0) 推荐(0)
摘要: private _PLACEHOLDER: string; @Input() public set placeholder(v: string) { this._PLACEHOLDER = v; } public get placeholder(): string { if (this._PLACEHOLDER) { return this._PLACEHOLDER; } else { retur 阅读全文
posted @ 2019-09-11 16:16 liliyou 阅读(713) 评论(0) 推荐(0)
摘要: 单例模式:确保一个类只有一个实例,并提供一个全局 访问点来访问这个唯一实例 单例模式要点 1.构造函数为private 2.提供一个类型为自身的私有静态成员变量 3.提供一个公有的静态工厂方法 阅读全文
posted @ 2019-09-08 09:30 liliyou 阅读(99) 评论(0) 推荐(0)
摘要: using System; namespace ConsoleApp { class Program { static void Main(string[] args) { string str = "askljd sadsa dsakld sa?dsad"; Console.WriteLine(str.GetWordCount()); Console.ReadKey(); } } /// <su 阅读全文
posted @ 2019-09-07 22:44 liliyou 阅读(180) 评论(0) 推荐(0)
摘要: // 学习接口隔离原则 using System; namespace console { class Program { static void Main(string[] args) { Person p = new Person(new Car()); Person p1 = new Pers... 阅读全文
posted @ 2019-08-28 22:39 liliyou 阅读(84) 评论(0) 推荐(0)
摘要: public class Dog{ public static void main(String[]args){ A a= new A(); a.add(); //java实例对象可以访问类的静态方法和静态字段,C#却不能; int id = a.id; System.out.println(id); } } cla... 阅读全文
posted @ 2019-08-10 14:58 liliyou 阅读(443) 评论(0) 推荐(0)
摘要: using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { HelpAttribute helpAttribute; foreach (var item in typeof(AnyCl... 阅读全文
posted @ 2019-08-06 15:40 liliyou 阅读(89) 评论(0) 推荐(0)
摘要: 输出: 分析: 1.先根据层次链找到最顶层的基类,先调用基类构造函数,再依次调用各级派生类构造函数, 2.派生类会隐式地调用父类构造函数 显示调用父类构造函数: 析构函数则与构造函数相反 派生类没有构造函数则隐式调用基类无参构造函数: 阅读全文
posted @ 2019-07-20 14:38 liliyou 阅读(966) 评论(0) 推荐(0)
摘要: 在config.xml里面设置 阅读全文
posted @ 2019-06-11 17:17 liliyou 阅读(1033) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页