IsolatedStorageFileStream.CanWrite Property

 

Gets a Boolean value indicating whether you can write to the file.

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

public override bool CanWrite { get; }

Property Value

Type: System.Boolean

true if an IsolatedStorageFileStream object can be written; otherwise, false.

Use this property to determine whether the IsolatedStorageFileStream object can be written.

The following code example demonstrates how you could use the CanWrite property, as a check to see whether a stream can be read before calling the Write or BeginWrite methods. For the complete context of this example, see the IsolatedStorageFileStream overview.

Console.WriteLine("Is the target file writable? " + (target.CanWrite ? "true" : "false"));

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: