简体   繁体   English

从外部程序将数据读取到我的C#WPF程序中

[英]Read data from an external program into my C#, WPF-program

I would like to read data from an external program (click) (a langenscheidt dictionary), it has thousend of entries in it and I want to read these key values into my WPF application(may be into a grid). 我想从一个外部程序(单击) (一个langenscheidt词典)中读取数据,它具有大量的条目,并且我想将这些键值读取到我的WPF应用程序中(可能放入网格中)。

There is a folder. 有一个文件夹。 with some human unreadable files(" .prc, .prc.hdx,*.prc.idx) 带有一些人类不可读的文件(“ .prc, .prc.hdx,*。prc.idx)

\Paragon Software\Langenscheidt 7\dictionaries

I thought this could be useful, but I am note sure because the folder name leads me to the conclusion, that the data is stored in these files, but these file extensions obviously can not be read by "Kindle" or "AutoCad". 我以为这可能有用,但是我可以肯定,因为文件夹名称使我得出结论:数据存储在这些文件中,但是这些文件扩展名显然不能被“ Kindle”或“ AutoCad”读取。

But I don't know where to start.( I found some results in google, but this didn't help me a lot.) 但是我不知道从哪里开始。(我在google中找到了一些结果,但这对我没有太大帮助。)

May be you could suggest me some good literature, keywords or good links to my problem ? 也许您可以建议我一些好的文献资料,关键字或与我的问题的良好链接?

By the way, the link for the testversion can be found here click . 顺便说一下, 单击此处可找到testversion的链接。

If those are text files (and small enough for you to fit them in memory) then you can just use: 如果这些是文本文件(并且足够小以适合您放入内存),则可以使用:

string text = File.ReadAllText(@"C\Path\To\File.prc");

then parse your string however you need to. 然后根据需要解析您的字符串。

There is also: 还有:

List<string> lines = File.ReadAllLines(@"C\Path\To\File.prc");

if line by line processing is easier to parse 如果逐行处理更容易解析

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM