摘要:
string sql = "select from {0}"; System.Text.StringBuilder where = new System.Text.StringBuilder(); where.Append(string.Format("{0} where 1=1", "db.use 阅读全文
摘要:
单例模式,就是同一时间只有一个该类的对象存在 region 单例模式一 //简单版本 多线程不安全。可以会在同一时间点上都创建一个实例,虽然一般不会出异常错误,但是起码不是我们谈论的只保证一个实例了。 public sealed class Singleton_1 { private string 阅读全文
摘要:
1.比较两个对象是否相同时, == 比 Equals效率更高 class Foo { string Name { set; get; } } static void Main() { Foo f = new Foo(); Foo f2 = new Foo(); var watch = new Sto 阅读全文
摘要:
public Bitmap getnew(Image bit, int TargetWidth, int TargetHeight)//beishu参数为放大的倍数。放大缩小都可以,0.8即为缩小至原来的0.8倍 { Bitmap destBitmap = new Bitmap(TargetWidt 阅读全文