C# FileStream Name

Description

FileStream Name Gets the name of the FileStream that was passed to the constructor.

Syntax

FileStream.Name has the following syntax.


public string Name { get; }

Example


using System;/*from  w  w  w  .j  ava 2  s  .  c  o m*/
using System.IO;

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

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