Partager via


StorageContainer.OpenFile Method (String, FileMode, FileAccess, FileShare)

Opens a file in the StorageContainer in the designated mode with the specified read/write access and sharing permission.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in microsoft.xna.framework.storage.dll)

Syntax

public Stream OpenFile (
         string file,
         FileMode fileMode,
         FileAccess fileAccess,
         FileShare fileShare
)

Parameters

  • file
    Type: String
    Relative path of the file within the StorageContainer.
  • fileMode
    Type: FileMode
    One of the enumeration values that specifies how to open the file.
  • fileAccess
    Type: FileAccess
    One of the enumeration values that specifies whether the file is opened with read, write, or read/write access.
  • fileShare
    Type: FileShare
    A bitwise combination of enumeration values that specify the type of access other Stream objects have to this file.

Return Value

A file opened in the designated mode with the specified access and sharing options.

See Also

Reference

StorageContainer Class
StorageContainer Members
Microsoft.Xna.Framework.Storage Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP