After days of fiddling around and futile googling, 'Assets.Open(@"test.db")' was the key:
//Open your local db as the input stream
Stream myInput = Assets.Open(@"test.db");
string outFileName = Path.Combine(System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal), "test.db");
//Open the empty db as the output stream
Stream myOutput = new FileStream(outFileName,FileMode.OpenOrCreate);
byte[] buffer = new byte[1024];
int b = buffer.Length;
int length;
while ((length = myInput.Read(buffer,0,b))>0){
myOutput.Write(buffer, 0, length);
}
//Close the streams
myOutput.Flush();
myOutput.Close();
myInput.Close();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…