zoukankan      html  css  js  c++  java
  • NET 2.0学习

     

    Stopwatch类:

    提供一组方法和属性,可用于准确地测量运行时间

     

    Stopwatch myWatch = new Stopwatch();

    myWatch.Start();

    代码段

    myWatch.Stop();

    Text1Box.Text="运行时间 " +  myWatch.ElapsedMilliseconds.ToString() + " ms";

     

     

    读取数据库联接字段

    ConnectionStringSettings myConnectionSettings = ConfigurationManager.ConnectionStrings[myconnectionstr];

    使用ConfigurationManager时必须将System.configuration库引用而不能只简单的使用using

     

    20提供了一个DbProviderFactory的工厂类,使用前需 using System.Data.Common;

     

    关键字partial 2.0新提供的。可以将代码拆分到多个文件

     

     

    通过工程中的Settings.settings来设置属性值,在代码中通过

    Properties.Settings.Default.mysettingstr来读取属性值

    Properties.Settings.Default.Save();来保存属性值

    这样可以实现代码与设置的分离。数据存储在user.config.xml文件

     

     

     

  • 相关阅读:
    php去除数组中重复值,并返回结果!
    SignalR 2 入门
    SignalR支持的平台
    SignalR简介
    作业调度系统quartz.net
    Oracle安装心得
    maven的项目目录解析
    web.xml的<url-parttern>的匹配规则
    Web.xml中四种验证方式
    Web.xml
  • 原文地址:https://www.cnblogs.com/forrestsun/p/347050.html
Copyright © 2011-2022 走看看