C# StreamWriter Write(Int32)

Description

StreamWriter Write(Int32) Writes the text representation of a 4-byte signed integer to the text string or stream.

Syntax

StreamWriter.Write(Int32) has the following syntax.


public virtual void Write(
  int value
)

Parameters

StreamWriter.Write(Int32) has the following parameters.

  • value - The 4-byte signed integer to write.

Returns

StreamWriter.Write(Int32) method returns

Example


using System;//from  ww  w .ja  v a2  s . c  o m
using System.IO;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string fileName = "test.txt";

        using (StreamWriter writer = new StreamWriter(fileName))
        {
            writer.Write((Int32)123);
        }
    }
}




















Home »
  C# Tutorial »
    System.IO »




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