Understanding Input/Output (I/O) Classes Lesson 5.

Slides:



Advertisements
Similar presentations
Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD.
Advertisements

Reading and Writing Text Files Svetlin Nakov Telerik Corporation
.NET Framework Overview. Whats in the 1.1 Framework physical assemblies physical assemblies Hundreds of namespaces Hundreds of namespaces.
Pemrograman VisualMinggu …12… Page 1 MINGGU Ke Duabelas Pemrograman Visual Pokok Bahasan: File and Stream Tujuan Instruksional Khusus: Mahasiswa dapat.
Files & Streams. Files Introduction Files are used for long-term retention of large amounts of data, even after the program that created the data terminates.
File Systems Files and directories Absolute and relative names Text and binary files Sequential-access and random-access files.
C# Programming: From Problem Analysis to Program Design1 Working with Files C# Programming: From Problem Analysis to Program Design 3 rd Edition 13.
File and Streams There are many ways of organizing records in a file. There are many ways of organizing records in a file. The most common type of organization.
MIS316 – BUSINESS APPLICATION DEVELOPMENT – Chapter 14 – Files and Streams 1Microsoft Visual C# 2012, Fifth Edition.
Console and File I/O - Basics Rudra Dutta CSC Spring 2007, Section 001.
ENCODING AND DECODING Experiencing one (or more) bytes out of your A’s.
2. I/O Text Files CCSA225 - Advanced Java Programming Sarah Alodan
Computer and Programming File I/O File Input/Output Author: Chaiporn Jaikaeo, Jittat Fakcharoenphol Edited by Supaporn Erjongmanee Lecture 13.
Lecture Set 12 Sequential Files and Structures Part B – Reading and Writing Sequential Files.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Stream Handling Streams - means flow of data to and from program variables. - We declare the variables in our C++ for holding data temporarily in the memory.
Chapter 12 Working with Files CIS 3260 Introduction to Programming using C# Hiro Takeda.
DATA COMMUNICATION DONE BY: ALVIN SAMPATH CARLVIN SAMPATH.
Neal Stublen Open/Close Connections  ADO.NET uses “connection pooling” to optimize opening and closing connections to the database.
ASP.NET 2.0 Chapter 5 Advanced Web Controls. ASP.NET 2.0, Third Edition2 Objectives.
Microsoft Visual Basic 2008 CHAPTER NINE Using Arrays and File Handling.
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
CSCI 3327 Visual Basic Chapter 6: Methods: A Deeper Look UTPA – Fall 2011.
Lector: Aliyev H.U. Lecture №5 Telecommunication network software design with.NET. Using streams for network programming TASHKENT UNIVERSITY OF INFORMATION.
 2006 Pearson Education, Inc. All rights reserved Files and Streams.
1 14/10/58Dr.Mud-Armeen Munlin 1 Files and Streams ผศ. ดร. หมัดอามีน หมันหลิน Faculty of IST, MUT
File I/O Static void Main( ) {... } data. Topics I/O Streams Reading and Writing Text Files Formatting Text Files Handling Stream Errors File Pointers.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Chapter 11 File Systems and Directories. 2 File Systems File: A named collection of related data. File system: The logical view that an operating system.
SE-1020 Dr. Mark L. Hornick 1 File Input and Output.
JAVA I/O © EnhanceEdu, IIIT Hyderabad. Contents 3/29/2010EnhanceEdu, IIIT - H 2  Command Line I/O  File Class  Streams  Byte Streams [Low level and.
Reference: Lecturer Lecturer Reham O. Al-Abdul Jabba lectures for cap211 Files and Streams- I.
Object Oriented Software Development 10. Persistent Storage.
Files and Streams. Objectives Learn about the classes that support file input/output Understand the concept of abstraction and how it related to the file.
Lecture 19 Serialization Richard Gesick. Serialization Sometimes it is easier to read or write entire objects than to read and write individual fields.
CS360 Windows Programming
Chapter 14: Files and Streams. 2Microsoft Visual C# 2012, Fifth Edition Files and the File and Directory Classes Temporary storage – Usually called computer.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
BIM313 – Advanced Programming File Operations 1. Contents Structure of a File Reading/Writing Texts from/to Files File and Directory Operations 2.
Understanding Databases Lesson 6. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Relational Database Concepts Understand relational.
Chapter -7 Basic function of Input/output system basics and file processing Stream classes : I/O Streams. A stream is a source or destination for collection.
Understanding Desktop Applications Lesson 5. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Windows Forms Applications Understand.
New Generation University Faculty of Computer Science Chapter Five: File Uploaded and Ad Rotate Lecturer: Mukhtar Mohamed Ali “Hakaale”
Creating Animations, Working with Graphics, and Accessing Data Lesson 9.
Input and Output 23: Input and Output
CSC 298 Streams and files.
File Input and Output Chapter 14 Java Certification by:Brian Spinnato.
Ajay Tripathi Input Output. Ajay Tripathi Input/output (IO) refers to the operations for reading and writing data to streams and files. In the.NET Framework,
Learners Support Publications Working with Files.
Files and Streams. What is a file? Up until now, any stored data within a program is lost when the program closes. A file is a permanent way to store.
Files and Streams. Objectives Learn about the classes that support file input/output Understand the concept of abstraction and how it related to the file.
XML Extensible Markup Language
Chapter 6: Creating Windows–based Applications 1 Microsoft® Visual C# 2008.
Module 6: Building .NET–based Applications with C#
Input and Output 23: Input and Output
C# Programming: From Problem Analysis to Program Design
Defiana Arnaldy, M.Si File and Stream I/O Defiana Arnaldy, M.Si
Lectures 12 Files & Streams Dr. Eng. Ibrahim El-Nahry.
How to work with files and data streams
Files and Streams.
Files and Streams Lect3 CT1411.
File Input/Output (I/O)
C Programming Lecture-15 File I/O
Files & Streams.
Input and Output with FILES
Files and Streams Lect10 GC201 12/1/2015.
Fundaments of Game Design
How to work with files and data streams
Chapter 15 Files, Streams and Object Serialization
Files and Streams.
Presentation transcript:

Understanding Input/Output (I/O) Classes Lesson 5

Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding console I/O Understand Console I/O (4.2) Understanding.NET File Classes Understand.NET File Classes (4.1) Understanding XML Classes in the.NET Framework Understand XML Classes in the.NET Framework (4.3)

Console Input/Output Console applications do not have a graphical user interface and use a text-mode console window to interact with the user. Console applications read from standard input stream. Console applications write to standard output stream. Console applications can receive input via command-line parameters.

The Console Class Provides methods for reading data from and writing data to the console window.

Console Methods in Action

Command-line Arguments The command-line arguments are the values passed to the Main method from the operating system. The Main method receives the command-line arguments as a string array.

Demonstration – Console Application

Manipulating Disk Files and Directories The File manipulation (example: copy, move, delete ) classes are part of the System.IO namespace The File and the FileInfo classes manipulate disk files. The Directory and DirectoryInfo classes manipulate directories and sub-directories. The File and the Directory classes contains only static methods. The FileInfo and the DirectoryInfo classes contain the instance methods.

File Input and Output The classes for file-based input and output are part of the System.IO namespace. Text files are the data files that contain only character-based data. The StreamReader and the StreamWriter classes manipulate text files. Binary files store any type of data as a sequence of bytes. The BinaryReader and the BinaryWriter classes manipulate binary files.

Text Files A text file is a disk file that stores only character- based data. Character encoding describes the rules by which each character is represented. There are different encoding schemes available, such as ASCIIEncoding, UTF8Encoding, and UnicodeEncoding. By using UTF8Encoding and UnicodeEncoding, you can represent characters from all the international languages.

Writing Text Files

Reading Text Files

Writing Binary Files

Reading Binary Files

XML XML (Extensible Markup Language) is a text-based format for representing structured data.

Working with XML The classes to work with XML data are organized in the System.Xml namespace. The XmlReader and XmlWriter classes provide methods to respectively read data from and write data to XML files. The XmlReader and XmlWriter classes provide a fast, non-cached, and forward-only way to read or write XML data.

Writing XML File

Reading XML File

XML Schema XML schema describes the structure of an XML document. An XML document is considered valid only when it conforms to its XML schema. XML schema is particularly important when an XML file is used to share data between two applications. Without XML schema, the applications won’t know how the data in an XML file is structured.

Recap Console Input/Ouput The Console class Console methods Command-line arguments Manipulating disk files and directories File input and output Text files Binary files XML Reading and writing XML XML Schema