New Year Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac75sure

Allen works as a Software Developer for ABC Inc.

Allen works as a Software Developer for ABC Inc. He develops a Windows application. He adds a form to the application named Form1, which contains a Label control named Label1. A text file named File1.txt contains a list of products. File1.txt is located in the application directory. Each product name is listed in a new line in File1.txt. Allen wants to retrieve a list of products from File1.txt and display it in Label1. He adds the following code to the application:

1. StreamReader Reader1 = new StreamReader((Stream)File.OpenText(Server.MapPath

("File1.txt")));

2. Stream MyStream;

3. string InputString;

4. // Insert statement here.

5. while (InputString != null)

6. {

7. Label1.Text = String.Format("{0}{1}", Label1.Text, InputString);

8. Reader1.ReadLine();

9. }

10. Reader1.Close();

Which of the following statements will Allen add at line 4 to accomplish the task?

A.

InputString = Reader1.ReadLine();

B.

InputString = Reader1.BaseStream.ToString();

C.

InputString = MyStream.ToString();

D.

InputString = MyStream.Read(b,0,Byte1.Length).ToString();

GSSP-.NET PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now GSSP-.NET pdf
Get 75% Discount on All Products, Use Coupon: "ac75sure"