在Windows Phone 8 C#应用程序中读/写

时间:2014-04-15 13:59:44

标签: c# windows-phone-8

我需要一些关于以下程序代码的帮助!为什么这段代码(写)会抛出错误?

写作:

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 + " .-";
    }
}

0 个答案:

没有答案