I/O Articles

C# Input, Output, Other File Operations, and Persisting Data

Welcome to the 9th tutorial in the "C# for the Completely Uninitiated" series.   Creating Files Programmatically Reading Files Checking For File Existence Moving a File to Another Location Source code used in this tutorial:   readerwriter.cs streamreader.cs char_by_char.cs file_attributes.cs file_copy.cs Creating Files Programmatically The first thing you need to know about file operations in […]

Read more

I/O in C# Unleased

Object | \—-BinaryReader——\ | |–>Binary IO used to read primitive data types(int,char..) |—-BinaryWriter——/ | | |—-Stream(Abstract) —> Byte Oriented IO | | | \ | |—–FileStream | |—–BufferedStream | `—–MemoryStream | | |—-TextReader(Abstract) —> Character Based IO (For Reading….) | | | \ | |—–StreamReader | `—–StringReader | `—-TextWriter(Abstract) —> Character Based IO (For Writing….) […]

Read more

How to Open and Read a File in Win Forms using C#

In this tutorial I am going to tell you abouthow to open your file and display it in the text box and how to saveyour file anywhere . HOW TO OPEN (READ) A FILE Open your new project and name it "filestream",then create a button and in properties change its text to "open textfile to […]

Read more

File Copier – WinForms Demonstration Program

Here is source for a file copier program that uses WinForms. using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using System.Windows.Forms;/// <remarks>/// File Copier – WinForms demonstration program/// (c) Copyright 2001 Liberty Associates, Inc./// </remarks>namespace FileCopier{ /// <summary> /// Form demonstrating Windows Forms implementation /// </summary> // < declarations of Windows widgets cut here > public class […]

Read more

Working with System.IO.Directory Class in C#

Introduction This article is focused on understanding the Directory class of System.IO namespace. The Directory class exposes routines for manipulating directories & subdirectories. It contains all kinds of routines like creating, moving, and enumerating through directories and subdirectories. In most of the application developments we require some file accesses or directory accesses normally we use […]

Read more

Manipulating Files With C#

This is a simple program that shows a bit ofhow to manipulate files in Visual C#.Net.I developed this as a "C# Console Application" and this simple programacts like a "DOS" operating system. The only file needed for theapplication is the "MyClass.cs". Open the "ReadMe" file in the zippedfile to see it's usage. Download FileManipulation.zip

Read more

TextReader and TextWriter In C#

INTRODUCTION: This article covers the information of how toread or write (Unicode) character based data through TextReader andTextWriter. The TextReader and TextWriter are base classes. TheStreamReader and StringReader derives from the abstract typeTextReader. Similarly the StreamWriter and StringWriter derives fromthe abstract type TextWriter. STREAMWRITERS & STREAMREADERS: As I mentioned earlier StreamWriter typederives from a base […]

Read more

Simple Text File Operations in C#.

C-Sharp provides a File class which is used in manipulating text files. The File class is within the System namespace. Also we can use the StreamReader and StreamWriter classes, which are within the System.IO, namespace for reading from and writing to a text file. In this article we’ll see examples of Creating a text file, […]

Read more