このコード行に問題があります。デバイスに sqlite データベースを作成したい。
string dbPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "\\test.db";
if (!System.IO.File.Exists(dbPath))
using (System.IO.Stream sr = ***Assets***.Open("test.db"))
{
using (System.IO.Stream srTo = System.IO.File.Create(dbPath))
{
sr.CopyTo(srTo);
}
}
このメッセージは次のことを示します: The name 'Assets' does not exist in the current context
同様のプロジェクトがありますが、大きなものよりも包括的です。エラーはありません。私が定義に従っているアセットは、c ドライブの cs ファイルを定義し、Android.Content.ContextWrapper への参照を提供します。プロジェクトのパスにありません。【アプリにファイルを追加した方法は?