重新嵌入SQLite数据库文件到同一个可执行文件 [英] Re-Embedding Sqlite Database file into the same Executable

查看:301
本文介绍了重新嵌入SQLite数据库文件到同一个可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建赢窗体应用程序,我将具有表中作为嵌入数据源的空SQLite数据库文件。在运行时我解压数据库文件到应用程序的路径和值插入到该数据库文件中的表。 再次关闭应用程序,我必须更新或替换数据库文件转换成可执行。 是否有可能,如果是的话该怎么做。

I'm Creating Win Form application ,I'm adding a Empty Sqlite Database file having Tables in it as embedded data source. on run time i extract Database file into application path and INSERT THE VALUES into the TABLE of that Database file. On Closing the application again i have to update or replace Database File into Executable. Is it possible ,if so how to do that.

推荐答案

我不知道,如果我理解正确的问题。如果你想重新写同一个exe文件正在运行,这是不可能的。锁定的Windows正在使用的,使他们不能改变code文件。此外,这是不可取的任一,code和数据应该是分开的。

I'm not sure if I understand the question correctly. If you are trying to re-write to the same exe you are running this is NOT possible. Windows locks code files that are in use so that they can't change. Additionally, it is not advisable either, code and data should be separate.

如果您要更新其他资源的可执行文件(即当前未在运行),我不知道该怎么做编程(见这个线程此处获得更多信息<一个href="http://stackoverflow.com/questions/6926378/how-do-i-replace-embedded-resources-in-a-net-assembly-programmatically">How我更换嵌入的资源在.NET组件编程?),但如果你的程序可以访问到Visual Studio编译器工具(它可能不会),您可以拆卸和重新组装的可执行文件。在这里看到:的http://fortheloveof$c$c.word$p$pss.com/2007/09/24/change-resources-inside-assembly/.

If you are trying to update another resources executable (that is not currently running), I don't know how to do that programatically (See this thread here for more info How do I replace embedded resources in a .NET assembly programmatically?) but if your program has access to the Visual Studio Compiler tools (which it probably doesn't) you can disassemble and reassemble the executable. See here: http://fortheloveofcode.wordpress.com/2007/09/24/change-resources-inside-assembly/.

这篇关于重新嵌入SQLite数据库文件到同一个可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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