Event Driven Programming

0.0(0)
studied byStudied by 4 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/50

flashcard set

Earn XP

Description and Tags

Streams

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

51 Terms

1
New cards

Streams

source that provides bytes, files, I/O etc.

2
New cards

Input Streams

File where data can be read

3
New cards

Output Streams

where data can be written ex. printer

4
New cards

System.IO

namespace that contains classes, Allows read n’ write of files

5
New cards

File Stream

Class that is used to create byte-oriented stream

6
New cards

FileStream (string filename, FileMode mode)

Code Of File Stream

7
New cards

mode

parameter that specifies how files are opened

8
New cards

FileMode.Create

new output file, will be overwritten if the file already exists

9
New cards

FileMode.CreateNew

creates new output file, not existing

10
New cards

FileMode.Open

Opens an Existing file

11
New cards

FileMode.OpenOrCreate

Opens existing file, If not creates one

12
New cards

FileMode.Truncate

open existing file, Truncates the content

13
New cards

ReadByte

read a single byte from a file, returns an integer as a value

14
New cards

Read

reads specified number of bytes from a file into an array

15
New cards

WriteByte

writes specified byte into the file

16
New cards

Flush

instantly writes data into the file

17
New cards

void Close

closes the file, releases system resources allocated

18
New cards

Seek

used to relocate file pointer in the file

19
New cards

Seek()

allows setting the file position indicator to a preferred location

20
New cards

Seek() Syntax

Long Seek (long n, SeekOrigin Location)

21
New cards

bool CanRead

returns true, if stream can be read

22
New cards

bool CanSeek

returns true, if stream supports position request

23
New cards

bool CanTimeout

returns true, if stream can timeout

24
New cards

bool CanWrite

returns true, if stream can be written

25
New cards

long length

contains size of the stream

26
New cards

int ReadTimeout

indicates time before timeout occurs for read

27
New cards

int WriteTimeout

indicates time before timeout occurs for write

28
New cards

Stream Writer

write character to a stream

29
New cards

StreamWriter (Stream stream)

creates character-based output stream

30
New cards

StreamWriter (string fileName)

open file directly (sw)

31
New cards

Close()

closes the file , mandatory to StreamReader

32
New cards

write()

file stream class, writes into specified file

33
New cards

WriteLine()

line by line, write into file

34
New cards

StreamReader

class that read character from aa byte stream

35
New cards

StreamReader (Stream stream)

name of open stream ex. I/O

36
New cards

StreamReader (string fileName)

specifies the name of the file to open

37
New cards

Read () sr

from the file stream, Reads content

38
New cards

ReadLine() sr

from file stream, reads content line by line

39
New cards

ReadToEnd()

current location to end of stream, reads all characters

40
New cards

Peek()

returns value of stream without moving file pointer

41
New cards

Seek()

sets the file pointer at desired position

42
New cards

Assemblies

files that contain compiled code

43
New cards

.dll

reusable components

44
New cards

.exe

standalone applications

45
New cards

Metadata

includes information about data types

46
New cards

Manifest

holds information of the assembly

47
New cards

Private assembly

simplest, used only within software package, 2 not a problem, not require registry entries

48
New cards

Shared assembly

libraries that other application can use

49
New cards

Name collision

same name of class with other shared assemblies, might overwrite assembly, give a unique or strong name to avoid collision

50
New cards

GAC (Global assembly cache)

enables app to share assembly, required to add assembly to special directory, centralized location

51
New cards

Creating shared assembly

  1. create project containing class file

  2. strong name (strong.snk) located at solutions explorer

  3. specify the key filename AssemblyInfo.cs

  4. Compile project to create, extension will be .dll