- 浏览: 701733 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (1081)
- [网站分类]1.首页原创精华.NET区(包含架构设计、设计模式)(对首页文章的要求:原创、高质量、经过认真思考并精心写作) (0)
- [网站分类]2..NET新手区(用于发表不合适发表在首页的.NET技术文章,包括小经验、小技巧) (1)
- [网站分类]3.非技术区(技术之外的文章,但不要涉及任何政治内容) (0)
- [网站分类]4.其他技术区 (0)
- [网站分类]5.企业信息化 (0)
- [网站分类]6.读书心得区(技术书籍阅读心得、书籍推荐) (0)
- [网站分类]7.提问区(.NET技术方面的提问) (2)
- [网站分类]8.技术转载区(.NET技术文章转载, 请注明原文出处) (0)
- [网站分类]9.求职招聘区(个人求职、企业招聘) (0)
- [网站分类]Dottext区 (0)
- [网站分类]GIS技术 (0)
- [网站分类]IT英才专区(IT职场交流) (0)
- [网站分类]SharePoint (0)
- [网站分类]博客园.NET俱乐部(俱乐部组织与活动方面的文章) (0)
- [网站分类]软件发布区(发布自己开发的代码、软件) (0)
- [网站分类]网站管理区(网站管理方面的疑问、建议、意见, 寻求管理员帮助) (0)
- [网站分类]业界新闻 (1)
- 技术 (1)
- [随笔分类]生活感悟 (10)
- [随笔分类]C# (30)
- [随笔分类]AjaxPro教程 (3)
- [发布至博客园首页] (5)
- [随笔分类]简历 (0)
- [随笔分类]Linux (2)
- [随笔分类]技术聚会 (2)
- [随笔分类]ORM (1)
- [随笔分类]php (1)
- [随笔分类]创业 (1)
- [随笔分类]奇技淫巧 (1)
- [随笔分类]计划 (1)
- [随笔分类]架构&分层 (1)
- [随笔分类]整合行销 (1)
- [随笔分类]mac (1)
- [网站分类].NET新手区 (45)
- [网站分类]非技术区 (5)
- [网站分类]招聘区 (0)
- [随笔分类]单元测试 (1)
- [网站分类]其他技术区 (3)
- [网站分类]代码与软件发布 (6)
- [网站分类]提问区 (24)
- [随笔分类]ASP.NET (2)
- [随笔分类]FAQ (12)
- [随笔分类]开发人员工具 (1)
- [随笔分类]朗志轻量级项目管理解决方案 (1)
- [网站分类]读书区 (1)
最新评论
-
天使建站:
写和乱七八糟的 不知道从哪复制过来的 还是看这里吧j ...
jquery数组 -
hyn450:
你好,我最近也想了解一下竞争情报。不知道能不能交流一下呢 ?
最近的工作 -
lattimore:
这个连接打不开了阿!
使用vnc连ubuntu desktop -
MZhangShao:
奉劝你一句,以后在Ubuntu 用apt-get安装成功的软件 ...
关于xrdp的安装设置 -
f002489:
strftime
python下datetime类型的转换
<!----> 1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Linq;
5using System.Runtime.Serialization.Formatters.Binary;
6using System.Text;
7using BerkeleyDb;
8using Component;
9
10namespace ToolManager
11{
12 public class BDBRecord
13 {
14 public object Key { get; set; }
15 public string Value { get; set; }
16 } /**//// <summary>
17 /// BDB数据库操作类库
18 /// </summary>
19 public class BDBHelper
20 {
21
22 private string DBFilePath { get; set; }
23 private DBStoreType DBType { get; set; }
24 public enum DBStoreType : byte
25 {
26 Auto=1,
27 Queue,
28 Hash
29 }
30 [Obsolete("该构造函数已废弃 ,请使用BDBHelper(string dbfilePath)")]
31 public BDBHelper()
32 {
33 }
34
35 public BDBHelper(string dbfilePath)
36 {
37 this.DBFilePath = dbfilePath;
38 }
39 [Obsolete("该构造函数已废弃 ,请使用BDBHelper(string dbfilePath)")]
40 public BDBHelper(string dbfilePath, DBStoreType type)
41 {
42 this.DBFilePath = dbfilePath;
43 this.DBType = type;
44 }
45 public BDBRecord FindOne()
46 {
47 return this.FindOne(null);
48 }
49 public BDBRecord FindOne(Func<object, string, bool> predicate)
50 {
51 //Dictionary<string, object> dict = new Dictionary<string, object>();
52 try
53 {
54 Queue格式#region Queue格式
55 //if (this.DBType == DBStoreType.Queue)
56 //{
57 using (Db db = new Db(DbCreateFlags.None))
58 {
59 db.RecLen = 5000;
60 db.RecPad = '.';
61 DbQueue file = (DbQueue)db.Open(null, this.DBFilePath, null, DbType.Queue, Db.OpenFlags.Create, 0);
62 using (DbQueueCursor cursor = file.OpenCursor(null, DbFileCursor.CreateFlags.None))
63 {
64 foreach (KeyDataPair kvp in cursor)
65 {
66 BinaryFormatter bf = new BinaryFormatter();
67 MemoryStream stream = new MemoryStream();
68 stream.Write(kvp.Data.Buffer, 0, kvp.Data.Size);
69 stream.Seek(0, SeekOrigin.Begin);
70 string k = BitConverter.ToInt32(kvp.Key.Buffer, 0).ToString();
71 object v = bf.Deserialize(stream);
72 if (predicate == null)
73 {
74 return new BDBRecord() { Key = v, Value = k };
75 }
76 else if (predicate(v, k))
77 {
78 return new BDBRecord() { Key = v, Value = k };
79 }
80 }
81 }
82 }
83 //}
84 #endregion
85 }
86 catch (Exception ex)
87 {
88 Hash格式#region Hash格式
89 //else if(this.DBType==DBStoreType.Hash)
90 //{
91 //遍历数据
92 &nbs
2using System.Collections.Generic;
3using System.IO;
4using System.Linq;
5using System.Runtime.Serialization.Formatters.Binary;
6using System.Text;
7using BerkeleyDb;
8using Component;
9
10namespace ToolManager
11{
12 public class BDBRecord
13 {
14 public object Key { get; set; }
15 public string Value { get; set; }
16 } /**//// <summary>
17 /// BDB数据库操作类库
18 /// </summary>
19 public class BDBHelper
20 {
21
22 private string DBFilePath { get; set; }
23 private DBStoreType DBType { get; set; }
24 public enum DBStoreType : byte
25 {
26 Auto=1,
27 Queue,
28 Hash
29 }
30 [Obsolete("该构造函数已废弃 ,请使用BDBHelper(string dbfilePath)")]
31 public BDBHelper()
32 {
33 }
34
35 public BDBHelper(string dbfilePath)
36 {
37 this.DBFilePath = dbfilePath;
38 }
39 [Obsolete("该构造函数已废弃 ,请使用BDBHelper(string dbfilePath)")]
40 public BDBHelper(string dbfilePath, DBStoreType type)
41 {
42 this.DBFilePath = dbfilePath;
43 this.DBType = type;
44 }
45 public BDBRecord FindOne()
46 {
47 return this.FindOne(null);
48 }
49 public BDBRecord FindOne(Func<object, string, bool> predicate)
50 {
51 //Dictionary<string, object> dict = new Dictionary<string, object>();
52 try
53 {
54 Queue格式#region Queue格式
55 //if (this.DBType == DBStoreType.Queue)
56 //{
57 using (Db db = new Db(DbCreateFlags.None))
58 {
59 db.RecLen = 5000;
60 db.RecPad = '.';
61 DbQueue file = (DbQueue)db.Open(null, this.DBFilePath, null, DbType.Queue, Db.OpenFlags.Create, 0);
62 using (DbQueueCursor cursor = file.OpenCursor(null, DbFileCursor.CreateFlags.None))
63 {
64 foreach (KeyDataPair kvp in cursor)
65 {
66 BinaryFormatter bf = new BinaryFormatter();
67 MemoryStream stream = new MemoryStream();
68 stream.Write(kvp.Data.Buffer, 0, kvp.Data.Size);
69 stream.Seek(0, SeekOrigin.Begin);
70 string k = BitConverter.ToInt32(kvp.Key.Buffer, 0).ToString();
71 object v = bf.Deserialize(stream);
72 if (predicate == null)
73 {
74 return new BDBRecord() { Key = v, Value = k };
75 }
76 else if (predicate(v, k))
77 {
78 return new BDBRecord() { Key = v, Value = k };
79 }
80 }
81 }
82 }
83 //}
84 #endregion
85 }
86 catch (Exception ex)
87 {
88 Hash格式#region Hash格式
89 //else if(this.DBType==DBStoreType.Hash)
90 //{
91 //遍历数据
92 &nbs
发表评论
-
请教一个winform程序设计上的问题
2007-07-12 02:22 669想要做一个功能,点击按钮出现一个键菜单,如下图所示:而在我的程 ... -
模拟提交程序相关专题
2007-11-29 18:53 930目录 模拟提交程序相关专题 1 目录 ... -
如何使用树形控件
2007-11-29 18:58 1321目录 如何使用树形控件 1 目录 2 ... -
XML文档数据操作心得
2007-11-29 19:00 741目录 XML文档数据操作心得 1 修订历史纪录 ... -
自制线程池3续
2008-08-13 13:59 621晚上睡觉前想到一些问题,发现有几种情形没有进行测试,遂记录下来 ... -
刚才是不是访问出问题了
2008-08-14 20:08 606Invalid URL The requested URL & ... -
Mock介绍
2008-08-17 19:48 1015在园子里搜索了一下, ... -
单元测试介绍
2008-08-18 07:25 701希望能不落熟套,在这里记录单元测试使用中的一些技巧 1.刚从英 ... -
最近几天的工作总结
2008-08-21 16:29 632缓存真的很重要,这几天在做信息采集的过程中,需要动态的生成程序 ... -
BDB使用总结
2008-08-24 12:26 693当对数据库设置了DbFlags.Dup后,允许重复的键值, 当 ... -
截图留念
2008-08-28 20:57 348... -
分布式信息采集程序Preview2
2008-08-29 17:17 576http://files.cnblogs.com/lexus/ ... -
boo & python笔记
2008-08-30 21:22 560在这里记录一下,自己的复习所得,有大概一个月没有碰这些东西了, ... -
log4net udp组件的应用
2008-08-30 23:57 724由于输出的调试信息非常之多,加上早前有一些用的是Console ... -
检测你的机子上装了什么版本的.net framework
2009-12-09 09:20 668这个想法由来已久,今天又碰上有人问我这个问题,使出吃奶的劲尔狠 ... -
关于程序日志的设计思考,及写程序时候的心态2009-12-16
2009-12-16 10:00 828最近在写一个分布式缓 ... -
最近几天的工作总结
2008-08-21 16:29 747缓存真的很重要,这几天在做信息采集的过程中,需要动态的生成程序 ... -
BDBViewer
2008-08-23 10:37 564因为项目中用了BDB,可是BDB不像sqlite有众多的数据库 ... -
扩展方法应用
2008-08-23 16:26 678using System; using System.Coll ... -
BDB使用总结
2008-08-24 12:26 717当对数据库设置了DbFlags.Dup后,允许重复的键值, 当 ...
相关推荐
spring.net+ibatis.net+mvc配置demo.rar spring.net版本:1.3.2 ibatis.net版本:1.6.1 demo运行环境是VS2013 数据库表,我就没传了,测试的时候,建立表 CREATE TABLE [dbo].[Hair8_AD]( [ADId] [int] ...
bdb性能测试(包括查询、插入、删除)批量和单条的比较
BDB2007,无需安装,数据库设计工具
数据库设计工具BDB 最新版 v3.0 v3.0 下载: 1) 中文简体版: [url]http://www.bainsoft.com/downloads/BDB.rar[/url] 2) 英文版: [url]http://www.bainsoft.com/downloads/BDBEN.rar[/url] v3.0版本更新: 1, 增加...
自己写的bdb多线程接口, 打开数据库。然后就可以调用set和get来存储数据。
bdb学习资料bdb学习资料bdb学习资料bdb学习资料
基于bdb存贮的简单fifo持久队列,支持多个队列,采用bdb的btree方式组织数据。 启动参数说明: -n 数据库的文件名,默认为:xianglei.db -p http访问的端口号,默认:1985 -i http访问的ip地址,默认:127.0.0.1 -f ...
BDB Professional Edition v2.8 >BDB(Bain DB Builder)是跨数据库平台的数据库设计工具、 >目前版本支持的数据库平台: > √ Access > √ MS SQLServer > √ Oracle > √ MySQL > √ SQL...
您可以通过使用BDB来简化软件开发和部署过程: 1、数据库设计、自动安装:支持和数据库之间的正向和反向工程。 既可以通过BDB进行新的数据库设计,自动创建或更新至实体数据库、 也可导出现有数据库结构,并为其...
BDB使用指南,属于个人资源,个人学习研究的BDB心得
BDB(Bain DB Builder)是跨数据库平台的数据库设计工具、 目前版本支持的数据库平台: √ Access √ MS SQLServer √ Oracle √ MySQL √ SQLAnyWhere 通过其可以方便快捷进行数据库设计、创建数据库自动安装...
BDB使用指南,属于个人资源,个人学习研究的BDB心得
BDB Developer Edition v3.0 >BDB(Bain DB Builder)是跨数据库平台的数据库设计工具、 >目前版本支持的数据库平台: > √ Access > √ MS SQLServer > √ Oracle > √ MySQL > √ SQLAnyWhere...
<br>此外、在BDB中提供了对开发语言的支持、 其数据库结构定义文件采用XML标准格式、 并且开放了外部读取数据库结构的源程序(C#/Delphi/JAVA)、 您可以通过使用BDB来简化软件开发和部署过程: <br>1...
<br>此外、在BDB中提供了对开发语言的支持、 其数据库结构定义文件采用XML标准格式、 并且开放了外部读取数据库结构的源程序(C#/Delphi/JAVA)、 您可以通过使用BDB来简化软件开发和部署过程: <br>1...
BDB数据库BDB数据库
vxworks下bdb样例程序,包括连接数据库、插入、查找、删除等操作
新编译的BDB版本,支持更智能化的SQL 查询分析提示、 输入自动完成功能。 <br>该功能类似SQLPrompt或MySQL-Front的智能化输入。 不过与上述软件只能在单个特定数据库平台使用不同, BDB支持更多的数据库...
您可以通过BDB来简化软件开发和部署过程: 1,数据库设计。 通过BDB快速建立数据库模型。支持正向工程和反向工程, 以及数据库模型和实体数据库之间的比对更新和双向同步。 2,数据库部署。 通过BDB创建数据库...