热键和将数据库或XML文件放入参考资料 [英] Hot keys & puting a DB or an XML file in Resources

查看:73
本文介绍了热键和将数据库或XML文件放入参考资料的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

现在,我正在构建一个检测按键(不适用于黑客攻击)的程序,当按下两个键的预设组合时,它会执行某些操作,但是,我正在努力开发一种检测两个按键事件的方法同时,我在钥匙钩上收到了一个keydown事件,如果您需要代码的一部分,我将其发布.

至于我的第二个问题:是否可以将XML文件或DB放入程序的资源中,并且仍然能够从中进行读写?
如果可以将DB或XML保留在资源中,那么连接字符串将是什么样子?

我想将其保留为一个文件程序.用户下载程序时仅使用exe文件.

提前谢谢您.
Tsahi.

Hello,

Right now I''m building a program that detects key strokes (not for hacking) and when a preset combination of two keys is pressed it do something, However, I''m banging my head with developing a way to detect Two keydown events simultaneously, I got a keydown event on the keyhook, if you need parts of the code I''ll post it.

As for my second question: Is it possible to put an XML file or DB in the Resources of the program and still be able to write and read from it?
If it is possible to keep the DB or XML in the resources How would the connection string will look like?

I want to keep it a one file program. using just the exe file when a user download the program.

Thank you in advance.
Tsahi.

推荐答案

还不太明白为什么要在程序中放置XML?您可以执行此操作,但是用户又无法修改其内容.根据描述,我猜想修改程序外的热键才是重点.

如果由于分发而只需要一个文件,那么一个小的MSI程序包就能满足您的要求.

关于数据库,您可以将XML放入数据库中,例如SQL Server本机支持XML,因此您可以通过SQL修改其内容.详细信息: xml(Transact-SQL) [
Don''t quite see why you want to place the XML inside the program? You can do that, but then again, the user isn''t able to modify it''s content. Based on the description I would guess that modifying the hot keys outside the program is the point.

If you want to have a single file because of distribution, would a small MSI package satisfy your requirements.

About the DB, you can put the XML inside a database and for example SQL Server supports natively XML so you can modify it''s content via SQL. More information: xml (Transact-SQL)[^]


不要以为没有同时发生两个按键事件的事情,因为只有一个键盘可以序列化所有事件? (而且即使使用两个单独的键盘,我也不认为它们可以同时使用.)

我认为在按住一个键的同时按住其他键的情况下,您需要按键调和.但这是另一回事.最简单的方法是记住每个键的键状态,以响应KeyDownKeyUp事件.

—SA
Don''t you think there is no such thing as two key events simultaneously, as you have only one keyboard which serializes all the events? (And I don''t think they can be simultaneous even with two separate keyboards.)

I think you need key accords, when you hold one key while keeping some other key(s) pressed. But this is a different thing. The simplest way of doing this is remembering a key status for each key in question in response to KeyDown and KeyUp events.

—SA


这篇关于热键和将数据库或XML文件放入参考资料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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