Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateFile Method

IsolatedStorageFile.CreateFile Method

Creates a file in the isolated store.

Namespace:  System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)

public IsolatedStorageFileStream CreateFile(
	string path
)

Parameters

path
Type: System.String
The relative path of the file to be created in the isolated store.

Return Value

Type: System.IO.IsolatedStorage.IsolatedStorageFileStream
A new isolated storage file.

ExceptionCondition
IsolatedStorageException

The isolated store has been removed.

-or-

Isolated storage is disabled.

ArgumentException

path is malformed.

ArgumentNullException

path is null.

DirectoryNotFoundException

The directory in path does not exist.

ObjectDisposedException

The isolated store has been disposed.

The following example creates files in the root of the store and in its subdirectories. This example is part of a larger example provided for IsolatedStorageFile class.


// Create a file in the root.
IsolatedStorageFileStream rootFile = store.CreateFile("InTheRoot.txt");
rootFile.Close();

// Create a file in a subdirectory.
IsolatedStorageFileStream subDirFile =
    store.CreateFile(Path.Combine(subdirectory1, "MyApp1A.txt"));
subDirFile.Close();


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft