C# FileStream CanTimeout

Description

FileStream CanTimeout Gets a value that determines whether the current stream can time out.

Syntax

FileStream.CanTimeout has the following syntax.


[ComVisibleAttribute(false)]
public virtual bool CanTimeout { get; }

Example


using System;/* ww  w  . j  av  a 2s . c om*/
using System.IO;
using System.Text;

class Test 
{
    public static void Main() 
    {
        string path = "MyTest.txt";
        using (FileStream fs = File.Create(path)) 
        {
            Console.WriteLine(fs.CanTimeout); 
        }
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter