public void SessionOpened(StorageSession session) { game.AppendStatusLine("Created."); var path = session.GetFullPathName("Test.txt"); if (File.Exists(path) == true) { text.Length = 0; using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { var reader = new StreamReader(stream); text.Append(reader.ReadToEnd()); } } game.AppendStatusLine("Done."); game.ContainerSessionFinished(); }
public void SessionOpened(StorageSession session) { game.AppendStatusLine("Created."); var path = session.GetFullPathName("Test.txt"); if (File.Exists(path) == true) { File.Delete(path); } using (var stream = new FileStream(path, FileMode.CreateNew, FileAccess.Write)) { var writer = new StreamWriter(stream); writer.Write(text); writer.Close(); } game.AppendStatusLine("Done."); game.ContainerSessionFinished(); }