Deck 13: Working with Files

ملء الشاشة (f)
exit full mode
سؤال
The GetAttributes( )method of the File class returns a FileAttribute,like Archive,when it invoked.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If an invalid path is listed in the constructor for the StreamWriter object,you will be prompted to reenter the file name.
سؤال
Prior to writing program statements that access data in a file,you should always check to make sure the file is available using the Available( )method.
سؤال
If you use Visual Studio and include a reference to the System.IO namespace,IntelliSense provides helpful information while you are developing your file application.
سؤال
The constructor for the StreamWriter can include additional arguments indicating whether the file should be appended to or overwritten if it already exists.
سؤال
In order to invoke the Copy( )method of the File class,instantiate an object of the File class and send as an argument a filename.
سؤال
In C#,when data is written to a file,it is stored in sorted order by a unique key.
سؤال
Streams are also used in C# to read and write data to binary files.
سؤال
A structure is a special form of value type that supplies alternate names for the values of an underlying primitive type.
سؤال
The StreamReader's Peek( )method returns the next available character but does not consume it.
سؤال
With Visual Studio when you create a file (or attempt to access one),if a path is not
specified with the filename,the Apps\Debug subdirectory of the current project is used.
سؤال
The Execution version of an application contains no debugging information and is considered an optimized solution.
سؤال
The constructor for the StreamWriter class is overloaded to include a Boolean variable indicating whether this is the first time the file was accessed.
سؤال
TextReader is an abstract class used to write primary data types as binary values.
سؤال
A data stream is the flow of data from a source to a receiver.
سؤال
File and Directory classes add functionality to their method members beyond that of FileInfo and DirectoryInfo classes.
سؤال
FileInfo and DirectoryInfo classes expose only static data members.
سؤال
To avoid fully qualifying references to objects of the StreamReader class,include a using statement with the System.StreamReader namespace.
سؤال
To programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exceptions thrown in an application,you should send the filename as an argument to Exists( )before attempting to construct an object.
سؤال
All attempts to access text files should be enclosed inside if...else blocks to check for
exceptions.
سؤال
Instead of hard coding the actual filename and file path,you could prompt the user for the name of the file using subclasses of the FileDialog class.
سؤال
The File,FileInfo,Directory,and DirectoryInfo classes are considered utility classes.They normally work with stream objects,allowing you to manipulate files and directory structures.
سؤال
The ____ class has implementations for Write( )and WriteLine( )methods similar to the Console class methods.

A) StreamWriter
B) Writer
C) TextWriter
D) FileWriter
سؤال
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
The identifier that can be referenced in a WriteLine( )method with the declaration above is ____.

A) someOutputFileName
B) someInputFileName
C) outputFile
D) inputFile
سؤال
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
If an invalid path is included with the constructor for a StreamWriter object,____.

A) an InValidPathException is thrown
B) a System exception occurs
C) an IOException exception is thrown
D) the program terminates
سؤال
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
What does the above statement do?

A) Retrieves one line of text from an input file.
B) Retrieves a single character from an input file.
C) Checks to see if the file is null.
D) Reads every line from an input file.
سؤال
No exception is thrown if you attempt to close or open a file that does not exist.
سؤال
The abstract classes of Stream,TextWriter,and TextReader are defined for dealing with files in the ____ namespace.

A) System.IO
B) System.Files
C) System
D) System.Stream
سؤال
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
Using the above segment of code,inValue would be defined as what type of data?

A) StreamReader
B) int
C) text
D) string
سؤال
None of the of the method named in the File and Directory classes are available as instance methods (with the same name)in the FileInfo and DirectoryInfo classes since they are available in File and Directory.
سؤال
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
If you browse using Windows Explorer or Computer,the physical file that already exists before the two statements from above are executed is ____.

A) outputFile
B) inputFile
C) someOutputFile
D) someInputFile
سؤال
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
Every member of the File class is static-meaning methods are called ____.

A) using the static keyword
B) with the file name
C) with an object name
D) with the class name
سؤال
To invoke File's Copy( )method to make a copy of "source.txt",naming the new file "target.txt",you would write: File.Copy("source.txt","target.txt");because Copy is a static member of the File class.
سؤال
Binary files can not be read using notepad.
سؤال
When you place an @ in front of a string,the string becomes a(n)____.

A) comment
B) verbatim string
C) numeric value
D) argument
سؤال
When you close a file,no arguments are sent to the method;however,the Close( )method must be called with a file object such as fileObjectInFile.Close( ).
سؤال
The StreamReader class is used to create text files.
سؤال
Which of the following class belongs to the System.IO namespace?

A) FileNotFoundException
B) DirectoryException
C) EndOfStreamException
D) System.InvalidException
سؤال
After an application is debugged and you are ready to deploy or distribute it,you can build the most optimized solution,a Release version.To switch to the Release version,select Release from the Solution Configurations list box on the Standard Visual Studio toolbar.
سؤال
The StreamReader class is most often used to retrieve single characters,one character at a time,from a file.
سؤال
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
Which of the following is an abstract class that cannot be instantiated?

A) FileDialog
B) ShowDialog
C) OpenFileDialog
D) Dialog
سؤال
Which exception is thrown when an attempt is made to access a file that does not exist?

A) FileLoadException
B) FileNotFoundException
C) FileNotAvailableException
D) FileException
سؤال
When writing text files,if you add true to the constructor for the Append argument,____.

A) lines are added onto the end of the file
B) a backup is made of the old file
C) "file already exists" message is displayed if a file by the same name exists
D) new data is added onto the end of each line in the file
سؤال
Which of the following class has public constructors?

A) Stream
B) TextReader
C) File
D) StreamReader
سؤال
The StreamReader class extends the ____ class.

A) File
B) FileInfo
C) TextReader
D) IO
سؤال
In order to remove a StreamWriter object named writer,which is associated with a file in the project directory called "test.dta",you would write ____.

A) File.Delete("test.dta")
B) File.Delete(writer)
C) writer.Delete("test.dta")
D) writer.Delete( )
سؤال
The FileDialog class has a property called ____,which is used by both the OpenFileDialog and SaveFileDialog classes to set or get the name of the file using a dialog box.

A) Text
B) Name
C) FileName
D) ID
سؤال
Which of the following is a static member of the Directory class?

A) Encrypted
B) AppendText( )
C) Exists( )
D) DirectoryPath( )
سؤال
Which method is used to cause the dialog boxes to open?

A) OpenDialog( )
B) RevealDialog( )
C) DisplayDialog( )
D) ShowDialog( )
سؤال
The StreamWriter method(s)that clears all buffers for the current writer and causes any buffered data to be written to the underlying stream is ____.

A) Write( ) or WriteLine( )
B) Close( )
C) Flush( )
D) Dispose( )
سؤال
The keyword ____ can be used to define a scope for an object such that the CLR automatically disposes of,or releases,the resource when the object goes out of scope.

A) scope
B) area
C) block
D) using
سؤال
Parent and Root are two key properties of which class?

A) FileInfo
B) StreamReader
C) DirectoryInfo
D) TextReader
سؤال
The most appropriate programmer-defined enumeration identifier for a card's color that has field values of Red,Blue,Yellow,Black,and Green would be ____.

A) card
B) CardColor
C) RedBlueYellowBlackGreen
D) 5Colors
سؤال
Which method,used with the StreamWriter class,can be invoked to write characters to the stream,followed by a line terminator?

A) StreamWrite( )
B) EndOfLine( )
C) Write( )
D) WriteLine( )
سؤال
BinaryReader and BinaryWriter classes ____.

A) expose only static members
B) are used to read and write character strings to files
C) offer streaming functionality oriented toward binary data types
D) are abstract classes
سؤال
If a StreamReader object named reader is instantiated and associated with a file stored in the project directory named "test.dta",which of the following statements would check to see if the "test.dta" exists?

A) if (File.Exists("test.dta"))
B) if (File.Exists(reader))
C) if (reader.Exists("test.dta"))
D) if (reader.Exists( ))
سؤال
Assume that an object of the DirectoryInfo is instantiated using the identifier dirListing.How could you retrieve the names of all files stored in dirListing that have a file extension of .cs?

A) foreach(FileInfo fil in dirListing.GetFiles("*.cs"))
B) foreach(FileInfo fil in dirListing.GetFiles("cs"))
C) foreach(DirectoryInfo dirListing in File.GetFiles("*.cs"))
D) foreach(DirectoryInfo dirListing in File.GetFiles("cs"))
سؤال
Objects of streams can be wrapped with _________ objects to improve the speed and performance of file-handling operations.

A) NetworkStream
B) FileStream
C) MemoryStream
D) BufferedStream
سؤال
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
With the above code segment,how could you programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exception thrown?

A) invoke File.Exists( ) before the while loop
B) invoke File.Exists( ) inside the while loop
C) include a try...catch block
D) test for File.Exists( ) instead of null
سؤال
The gray section below the Form object where dialog objects are placed in Visual Studio is called the ____.

A) dialog area
B) work tray
C) toolbox
D) component tray
سؤال
A(n)____________ is considered a named collection of bytes having persistent or lasting storage.
سؤال
The ____________ class makes it easy to write data to a file because it has implementations for the Write( )and WriteLine( )methods.
سؤال
A(n)____________ is a special form of value type that supplies names for the values.
سؤال
NET Framework includes the ____________ namespace,which provides basic file and directory support classes.It also contains types that enable you to read and write files and data streams.
سؤال
The files created using the ____________ class are readable by the computer but,unlike the files created by the StreamWriter class,you cannot simply open and read the contents of the file using Notepad.A program is needed to interpret the file contents.
سؤال
Archive is a(n)____________ value for the Attributes property of the File class.
سؤال
PadRight( )and PadLeft( )methods of the ____________ class can be use to right or left align values.
سؤال
Values can be processed in any order.The fifth data record can be retrieved and processed before the first record is processed when ____________ access is used.
سؤال
When a method uses a(n)____________ modifier,the method belongs to the class itself,not to a specific object of the class and is thus called using the class name.
سؤال
The ____________ class provides static methods that aid in creating and moving through folders and subdirectories.
سؤال
If you attempt to access a file and have an invalid path listed in the constructor,a(n)____________ exception is thrown.
سؤال
To ensure that the data is usable for the next application the ____________ method should be invoked before you exit the application.
سؤال
If you do not specify the full path for the filename,Visual Studio uses the ____________ subdirectory of the current project.
سؤال
One of the static methods of the File class is ____________.Prior to writing program statements that access data in a file,you should always check to make sure the file is available by invoking this method.
سؤال
The ____________ method of the StreamReader class enables you to retrieve one line of text from the file.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 13: Working with Files
1
The GetAttributes( )method of the File class returns a FileAttribute,like Archive,when it invoked.
True
2
If an invalid path is listed in the constructor for the StreamWriter object,you will be prompted to reenter the file name.
False
3
Prior to writing program statements that access data in a file,you should always check to make sure the file is available using the Available( )method.
False
4
If you use Visual Studio and include a reference to the System.IO namespace,IntelliSense provides helpful information while you are developing your file application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
5
The constructor for the StreamWriter can include additional arguments indicating whether the file should be appended to or overwritten if it already exists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
6
In order to invoke the Copy( )method of the File class,instantiate an object of the File class and send as an argument a filename.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
7
In C#,when data is written to a file,it is stored in sorted order by a unique key.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
8
Streams are also used in C# to read and write data to binary files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
9
A structure is a special form of value type that supplies alternate names for the values of an underlying primitive type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
10
The StreamReader's Peek( )method returns the next available character but does not consume it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
11
With Visual Studio when you create a file (or attempt to access one),if a path is not
specified with the filename,the Apps\Debug subdirectory of the current project is used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
12
The Execution version of an application contains no debugging information and is considered an optimized solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
13
The constructor for the StreamWriter class is overloaded to include a Boolean variable indicating whether this is the first time the file was accessed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
14
TextReader is an abstract class used to write primary data types as binary values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
15
A data stream is the flow of data from a source to a receiver.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
16
File and Directory classes add functionality to their method members beyond that of FileInfo and DirectoryInfo classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
17
FileInfo and DirectoryInfo classes expose only static data members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
18
To avoid fully qualifying references to objects of the StreamReader class,include a using statement with the System.StreamReader namespace.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
19
To programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exceptions thrown in an application,you should send the filename as an argument to Exists( )before attempting to construct an object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
20
All attempts to access text files should be enclosed inside if...else blocks to check for
exceptions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
21
Instead of hard coding the actual filename and file path,you could prompt the user for the name of the file using subclasses of the FileDialog class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
22
The File,FileInfo,Directory,and DirectoryInfo classes are considered utility classes.They normally work with stream objects,allowing you to manipulate files and directory structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
23
The ____ class has implementations for Write( )and WriteLine( )methods similar to the Console class methods.

A) StreamWriter
B) Writer
C) TextWriter
D) FileWriter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
24
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
The identifier that can be referenced in a WriteLine( )method with the declaration above is ____.

A) someOutputFileName
B) someInputFileName
C) outputFile
D) inputFile
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
25
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
If an invalid path is included with the constructor for a StreamWriter object,____.

A) an InValidPathException is thrown
B) a System exception occurs
C) an IOException exception is thrown
D) the program terminates
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
26
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
What does the above statement do?

A) Retrieves one line of text from an input file.
B) Retrieves a single character from an input file.
C) Checks to see if the file is null.
D) Reads every line from an input file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
27
No exception is thrown if you attempt to close or open a file that does not exist.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
28
The abstract classes of Stream,TextWriter,and TextReader are defined for dealing with files in the ____ namespace.

A) System.IO
B) System.Files
C) System
D) System.Stream
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
29
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
Using the above segment of code,inValue would be defined as what type of data?

A) StreamReader
B) int
C) text
D) string
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
30
None of the of the method named in the File and Directory classes are available as instance methods (with the same name)in the FileInfo and DirectoryInfo classes since they are available in File and Directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
31
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
If you browse using Windows Explorer or Computer,the physical file that already exists before the two statements from above are executed is ____.

A) outputFile
B) inputFile
C) someOutputFile
D) someInputFile
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
32
StreamWriter outputFile = new StreamWriter("someOutputFileName");
StreamReader inputFile = new StreamReader("someInputFileName");
Every member of the File class is static-meaning methods are called ____.

A) using the static keyword
B) with the file name
C) with an object name
D) with the class name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
33
To invoke File's Copy( )method to make a copy of "source.txt",naming the new file "target.txt",you would write: File.Copy("source.txt","target.txt");because Copy is a static member of the File class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
34
Binary files can not be read using notepad.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
35
When you place an @ in front of a string,the string becomes a(n)____.

A) comment
B) verbatim string
C) numeric value
D) argument
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
36
When you close a file,no arguments are sent to the method;however,the Close( )method must be called with a file object such as fileObjectInFile.Close( ).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
37
The StreamReader class is used to create text files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the following class belongs to the System.IO namespace?

A) FileNotFoundException
B) DirectoryException
C) EndOfStreamException
D) System.InvalidException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
39
After an application is debugged and you are ready to deploy or distribute it,you can build the most optimized solution,a Release version.To switch to the Release version,select Release from the Solution Configurations list box on the Standard Visual Studio toolbar.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
40
The StreamReader class is most often used to retrieve single characters,one character at a time,from a file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
41
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
Which of the following is an abstract class that cannot be instantiated?

A) FileDialog
B) ShowDialog
C) OpenFileDialog
D) Dialog
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which exception is thrown when an attempt is made to access a file that does not exist?

A) FileLoadException
B) FileNotFoundException
C) FileNotAvailableException
D) FileException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
43
When writing text files,if you add true to the constructor for the Append argument,____.

A) lines are added onto the end of the file
B) a backup is made of the old file
C) "file already exists" message is displayed if a file by the same name exists
D) new data is added onto the end of each line in the file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
44
Which of the following class has public constructors?

A) Stream
B) TextReader
C) File
D) StreamReader
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
45
The StreamReader class extends the ____ class.

A) File
B) FileInfo
C) TextReader
D) IO
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
46
In order to remove a StreamWriter object named writer,which is associated with a file in the project directory called "test.dta",you would write ____.

A) File.Delete("test.dta")
B) File.Delete(writer)
C) writer.Delete("test.dta")
D) writer.Delete( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
47
The FileDialog class has a property called ____,which is used by both the OpenFileDialog and SaveFileDialog classes to set or get the name of the file using a dialog box.

A) Text
B) Name
C) FileName
D) ID
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the following is a static member of the Directory class?

A) Encrypted
B) AppendText( )
C) Exists( )
D) DirectoryPath( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which method is used to cause the dialog boxes to open?

A) OpenDialog( )
B) RevealDialog( )
C) DisplayDialog( )
D) ShowDialog( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
50
The StreamWriter method(s)that clears all buffers for the current writer and causes any buffered data to be written to the underlying stream is ____.

A) Write( ) or WriteLine( )
B) Close( )
C) Flush( )
D) Dispose( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
51
The keyword ____ can be used to define a scope for an object such that the CLR automatically disposes of,or releases,the resource when the object goes out of scope.

A) scope
B) area
C) block
D) using
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
52
Parent and Root are two key properties of which class?

A) FileInfo
B) StreamReader
C) DirectoryInfo
D) TextReader
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
53
The most appropriate programmer-defined enumeration identifier for a card's color that has field values of Red,Blue,Yellow,Black,and Green would be ____.

A) card
B) CardColor
C) RedBlueYellowBlackGreen
D) 5Colors
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which method,used with the StreamWriter class,can be invoked to write characters to the stream,followed by a line terminator?

A) StreamWrite( )
B) EndOfLine( )
C) Write( )
D) WriteLine( )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
55
BinaryReader and BinaryWriter classes ____.

A) expose only static members
B) are used to read and write character strings to files
C) offer streaming functionality oriented toward binary data types
D) are abstract classes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
56
If a StreamReader object named reader is instantiated and associated with a file stored in the project directory named "test.dta",which of the following statements would check to see if the "test.dta" exists?

A) if (File.Exists("test.dta"))
B) if (File.Exists(reader))
C) if (reader.Exists("test.dta"))
D) if (reader.Exists( ))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
57
Assume that an object of the DirectoryInfo is instantiated using the identifier dirListing.How could you retrieve the names of all files stored in dirListing that have a file extension of .cs?

A) foreach(FileInfo fil in dirListing.GetFiles("*.cs"))
B) foreach(FileInfo fil in dirListing.GetFiles("cs"))
C) foreach(DirectoryInfo dirListing in File.GetFiles("*.cs"))
D) foreach(DirectoryInfo dirListing in File.GetFiles("cs"))
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
58
Objects of streams can be wrapped with _________ objects to improve the speed and performance of file-handling operations.

A) NetworkStream
B) FileStream
C) MemoryStream
D) BufferedStream
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
59
StreamReader inFile = new StreamReader("name.txt");
while ((inValue = inFile.ReadLine()) != null)
With the above code segment,how could you programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exception thrown?

A) invoke File.Exists( ) before the while loop
B) invoke File.Exists( ) inside the while loop
C) include a try...catch block
D) test for File.Exists( ) instead of null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
60
The gray section below the Form object where dialog objects are placed in Visual Studio is called the ____.

A) dialog area
B) work tray
C) toolbox
D) component tray
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
61
A(n)____________ is considered a named collection of bytes having persistent or lasting storage.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
62
The ____________ class makes it easy to write data to a file because it has implementations for the Write( )and WriteLine( )methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
63
A(n)____________ is a special form of value type that supplies names for the values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
64
NET Framework includes the ____________ namespace,which provides basic file and directory support classes.It also contains types that enable you to read and write files and data streams.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
65
The files created using the ____________ class are readable by the computer but,unlike the files created by the StreamWriter class,you cannot simply open and read the contents of the file using Notepad.A program is needed to interpret the file contents.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
66
Archive is a(n)____________ value for the Attributes property of the File class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
67
PadRight( )and PadLeft( )methods of the ____________ class can be use to right or left align values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
68
Values can be processed in any order.The fifth data record can be retrieved and processed before the first record is processed when ____________ access is used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
69
When a method uses a(n)____________ modifier,the method belongs to the class itself,not to a specific object of the class and is thus called using the class name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
70
The ____________ class provides static methods that aid in creating and moving through folders and subdirectories.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
71
If you attempt to access a file and have an invalid path listed in the constructor,a(n)____________ exception is thrown.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
72
To ensure that the data is usable for the next application the ____________ method should be invoked before you exit the application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
73
If you do not specify the full path for the filename,Visual Studio uses the ____________ subdirectory of the current project.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
74
One of the static methods of the File class is ____________.Prior to writing program statements that access data in a file,you should always check to make sure the file is available by invoking this method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
75
The ____________ method of the StreamReader class enables you to retrieve one line of text from the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 75 في هذه المجموعة.