C# FileStream WriteTimeout

Description

FileStream WriteTimeout Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.

Syntax

FileStream.WriteTimeout has the following syntax.


[ComVisibleAttribute(false)]
public virtual int WriteTimeout { get; set; }

Example

Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.


//from   w ww  .  j  av  a 2  s. c  o m

using System;
using System.IO;

class TestRW 
{
    public static void Main(String[] args)
    {
        FileStream s = new FileStream("MyFile.txt", FileMode.OpenOrCreate, FileAccess.Read);
        Console.WriteLine(s.ReadTimeout);
    }
}




















Home »
  C# Tutorial »
    System.IO »




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