Export (0) Print
Expand All

Storage

The Microsoft.Xna.Framework.Storage namespace provides classes that allow reading and writing of files.

In This Section

Storage Overview
The XNA Framework provides a set of classes in the Microsoft.Xna.Framework.Storage namespace that are used to read and write files from user storage and title storage, including player saves or title data.
How To: Create a File
This example demonstrates how to use the StorageContainer class to create a save game file in the title storage area on a device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Open a File
This example demonstrates how to use the StorageContainer class to open a save game file in the title storage area on a device specified by the gamer.
How To: Copy a File
This example demonstrates how to use the StorageContainer class to copy a save game file in the title storage area on a device specified by the gamer. This example assumes you have already obtained a StorageDevice - to obtain a StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Rename a File
This example demonstrates how to use the StorageContainer class to rename a save game file in the title storage area on a device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Enumerate Files
This example demonstrates how to use the StorageContainer class to get a list of save game files in the title storage area on a device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Delete a File
This example demonstrates how to use the StorageContainer class to delete a save game file in the title storage area on a device specified by the gamer. This example assumes you have already obtained a StorageDevice. To obtain a StorageDevice, see How To: Get a StorageDevice Asynchronously.
How To: Load a Game Data File
This example demonstrates how to use the File class to read a file from the game image directory.
How To: Serialize Data
This example demonstrates how to use the XmlSerializer class to write data in a custom class to a saved game, and how to load the data from the file.
How To: Get a StorageDevice Asynchronously
This example demonstrates how to call BeginShowStorageDeviceSelector and EndShowStorageDeviceSelector to get a StorageDevice object asynchronously.

Community Additions

ADD
Show:
© 2014 Microsoft