我对Raptor数据库的最后一个也是唯一一个问题? [英] My Last And Only Question About Raptor Database?

查看:156
本文介绍了我对Raptor数据库的最后一个也是唯一一个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最后三篇文章已经明确指出,我正在寻找一种方法,可以将文本文件("Master MD5 SIG.txt")中的值添加到raptordb,然后能够调用该数据库以读取值("Master MD5 SIG.txt"),以便我的程序将数据库中的值与当前文件系统进行比较.提供给我的代码仍然令人困惑,因为我不知道在哪里放置什么?

代码是:

My last three posts have clearly specified that I am looking for a way to add the values from my text file ("Master MD5 SIG.txt") to raptordb and then to have the ability to call upon that database to read the values ("Master MD5 SIG.txt") so that my program will compare the values in the database with my current filesystem. The code Supplied to me is still confusing as I have not a clue where to place what?

the code is:

RaptorDB.RaptorDB rap = RaptorDB.RaptorDB.Open("strings", 30, false, INDEXTYPE.HASH);
rap.IndexingTimerSeconds = 1;
rap.InMemoryIndex = true;
string key = "some very long string";
 
for (int i = 0; i < count; i++)
{
	string ss = key + i.ToString("000000");
	rap.Set(ss, ss);
}
 
rap.SaveIndex(true);
int j = 0;
for (int i = 0; i < count; i++)
{
	string ss = key + i.ToString("000000");
	byte[] bb = null;
	if (rap.Get(ss, out bb) == false)
		j++;// Console.WriteLine("error");
}





字符串"是什么意思?和一些很长的琴弦"?还有("000000")?即使将这段代码转换为VB.NET,语法"Count"也会出错,并且看起来您在代码中告诉我在我输入的代码中输入"Strings"和"Some Very Long String"的情况下输入了字符串需要添加文本文件.


谢谢任何可以帮助我学习如何使用它的人.由于OP没有响应或没有给出明确的说明,这迫使我不得不提出更多问题,因此我已经停滞不前.





What is meant by "String"? and "Some Very Long String"? and also ("000000")? Even after converting this code to VB.NET there is errors with the syntax "Count" and it looks as if your telling me in the code to enter strings where "Strings" and "Some Very Long String" is stated when the code that I need is to add the text file.


Thank you anyone who can help me to learn how to use this. I have come to some what of a stand still as the OP does not respond or give clear instructions which forces me to ask more questions.

推荐答案

一些基本知识:

1)字典或哈希表是用于存储键引用的信息的结构.
Some basics :

1) A dictionary or hashtable is a structure for storing information referenced by a key.
Dictionary<string,string> dic = new Dictionary<string,string>();
dic.Add("somestringkey","value associated with key"); // to set the value
dic["someotherkey"] = "another value for that key"; // another way to set a value

// to read
string val = dic["somestringkey"]; // will show "value associated with key"



2)在RaptorDB中创建哈希类型的键值存储,以将最多255个字符的字符串存储在名为storage的文件中(具有各种索引扩展名等).



2) To create a keyvalue store in RaptorDB of type hash for storing strings up to 255 chars in a file named storage (with various extensions for indexes etc.).

RaptorDB.RaptorDB rap = RaptorDB.RaptorDB.Open("storage", 255, false, INDEXTYPE.HASH);

rap.Set("somestringkey","value associated with key"); // to set like a dictionary

string val = "";
if(rap.Get("somestringkey", out val))
{
   // val now contains what was read 
}



3)从需求描述中,您想保存MD5哈希码作为文件名



3) From your description of your requirements you want to save MD5 hash codes for filenames

dic.Add("c:\\path\\filename.ext","123123134123123"); // MD5 hash for the filename.ext


这篇关于我对Raptor数据库的最后一个也是唯一一个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆