[英]Store a SQLite Database to local filesystem from a windows 8.1 App
I have made a Windows 8 store App. 我已经制作了Windows 8应用商店应用。 I want to make a SQLite database inside it, which can be stored on a filesystem on my computer ,in a location like "C:/My Documents/File.sqlite". 我想在其中创建一个SQLite数据库,该数据库可以存储在计算机上的文件系统中,位于“ C:/ My Documents / File.sqlite”之类的位置。 I am unable to figure out how to do that. 我无法弄清楚该怎么做。 Can anyone please suggest a way to do that. 任何人都可以建议一种方法来做到这一点。 Thanks in advance. 提前致谢。
The ultimate purpose is to read the database file from an external windows service. 最终目的是从外部Windows服务读取数据库文件。 The windows service is unable to read from the App's local storage folder. Windows服务无法从应用程序的本地存储文件夹中读取。 If there is any way to do that, that could also work. 如果有任何方法可以做到这一点。
The database will be stored in the app's local data and you can update your DB from there.
Path : C:\Users\sunilkumar.s\AppData\Local\Packages\"Your App Package"\LocalState\
You can access this in c# using this code
string strPath = ApplicationData.Current.LocalFolder.Path;
string strDatabaseName = "ABCD.db";
strFinalPath = System.IO.Path.Combine(strPath, strDatabaseName);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.