我需要一些关于以下程序代码的帮助!为什么这段代码(写)会抛出错误?
写作:
using (IsolatedStorageFile f = IsolatedStorageFile.GetUserStoreForApplication())
{
using (StreamWriter w = new StreamWriter(f.OpenFile("data.cfg", FileMode.Create)))
{
w.Write(penz.Text + " || " + tipus.Text + " || " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second);
}
}
读:
IsolatedStorageFile f = IsolatedStorageFile.GetUserStoreForApplication();
{
StreamReader r = new StreamReader(f.OpenFile("data.cfg", FileMode.OpenOrCreate));
{
fullmoney = int.Parse(r.ReadLine());
teljes.Text = "Full Money: " + fullmoney + " .-";
}
}