《 C#技术内幕》笔记1

1.IL:中间代码。.net编译器所编译的代码成为IL。

2.JIT实时编译器

3.CLR:公共语言运行时,comm langua runtime。 

4.CLS:公用语言运行规范 

5.CTS:common type system,公共类型系统

6.在创建数据库连接时,.net提供了一种设计模式:Idisposable. 可以使相应类集成Idisposable。并且调用时使用using,以保证对象结束时会调用Disposal方法。

例如:定义类 public class A : IDisposable

    {

       private SqlConnection conn = new SqlConnection();

        public void Dispose()

        {

            if (conn != null)

                conn.Dispose();

            conn = null;

        }

}

使用的时候要使用using 如:using (A as A ),这样才能保证会调用Dispose()。

相关文章:

  • 2022-01-09
  • 2021-12-14
  • 2021-06-29
  • 2021-08-06
  • 2021-11-16
  • 2021-10-04
  • 2021-04-27
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2021-06-02
  • 2022-01-04
  • 2021-06-03
  • 2021-08-19
  • 2022-12-23
相关资源
相似解决方案