public static void Main() { //var ts = new DbArray<kh.客户, kh.订单, kh.订单明细>(); //ts.Table1 = new kh.客户[] { new kh.客户 { 客户编号 = 1 }, new kh.客户 { 客户编号 = 2 } }; ////ts.Table2 = ////ts.Table3 = //byte[] buff = ts.GetBytes(); //var ts2 = new DbList<kh.客户, kh.订单, kh.订单明细>(buff); //ts2.Table1.Count.WL(); DbTable table = new DbTable(); // Declare DataColumn and DataRow variables. table.NewColumn("程序集名称", typeof(string), true); table.NewColumn("窗口标题", typeof(string), true); table.NewColumn("动作", typeof(int), true); table.NewColumn("结束时间", typeof(DateTime), true); table.NewColumn("开始时间", typeof(DateTime), true); table.Name = "windowslogs"; var list = new List <DesktopWindowInfo>(); //for (int i = 0; i < 5; i++) //{ // list.Add(new DesktopWindowInfo // { // 开始时间 = DateTime.Now, // 结束时间 = DateTime.Now, // 窗口标题 = "xxx", // 程序集名称 = "asdf", // 动作 = 窗口动作.关闭 // }); //} list.Add(new DesktopWindowInfo { 开始时间 = DateTime.Now, 结束时间 = DateTime.Now, 窗口标题 = null, 序集名称 = null, 动作 = 窗口动作.关闭 }); AddlistToRows(table, list); table.Dump(); var t = new DbTable(table.GetBytes()); t.Dump(); RL(); }