Join Anton Delsink for an in-depth discussion in this video File.Open and .Close, part of Object Oriented Programming with C#.
- [Instructor] Now let's take a look at an interface,…used by the compiler to make our life easier,…when it comes to resource management.…In particular the IDisposible interface,…and for this I'll use a file as a resource…that we need to manage, manage in the sense that…we are to be explicit about when we are finished with it.…So I open the project from the exercise folder,…in the begin folder.…This the solution we used earlier .NET Framework…with the project Tests,…and we'll use the same Tests .NET Framework file,…and just start at the bottom of the file.…
And so let's add a method.…And most of our examples will be about…the FileStream class, which implements IDisposible.…And so to read a file, we would create an instance…of the FileStream class, and that will help us…work with the file as a stream of bytes,…a sequence of bytes, coming at us from the file system.…So FileStream, press Esc here and then Ctrl dot,…is from the System.IO namespace, so add that at the top,…using System.IO, and I'll call my variable fs,…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.