DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 923018 - Last Review: June 20, 2014 - Revision: 3.0

On This Page

Summary

This article contains comments, corrections, and information about known errors relating to the Microsoft Press book MCTS Self-Paced Training Kit (Exam 70-536): Microsoft® .NET Framework 2.0—Application Development Foundation, 978-0-7356-2277-7. Additional corrections for this book are available in article 935218 (http://support.microsoft.com/kb/935218/) , 949730 (http://support.microsoft.com/kb/949730/) and 949734 (http://support.microsoft.com/kb/949734/) .

The following topics are covered:

  • CD-ROM: "not" should be removed from assessment question
  • CD-ROM: Assessment answer should include ICollection and not IDictionaryEnumerator
  • CD-ROM: Assessment answer should also include Resize event
  • CD-ROM: lesson3-exercise1-Person-partial code samples are missing from \Chapter01 folder
  • CD-ROM: Assessment qurestion scored incorrectly
  • Page 3: System.Value referenced rather than System.ValueType
  • Page 5: Date/date should be Date/none
  • Page 5: 4 should be 1
  • Page 9: NOTE is incorrect
  • Page 12: Term "defines" used in place of "initializes" in step 4
  • Page 14: Term "class" used in place of term "structure" in step 5
  • Page 18: The word "variable" is missing from the final sentence
  • Page 24: C# code sample missing
  • Page 25: Incorrect code in C# example
  • Page 46: Correction in code example
  • Page 47: "Guide" used in place of "Guid"
  • Page 49: Invalid character in VB code sample
  • Page 49: VB code sample missing Person class
  • Page 51: Methods incorrectly named
  • Page 52: "progressBar" used in place of "progressBar1" in code sample
  • Page 55: Incorrect description of narrowing conversion behavior
  • Page 58: Incorrect index used in the second code sample
  • Page 59: Decimal used in place of Double in code for Exercise 1
  • Page 63: "narrowing" used in place of "widening"
  • Page 72: "Exist property" referenced in place of "Exists property"
  • Page 73: string should be DirectoryInfo object
  • Page 74: DriveInfo class described incorrectly
  • Page 76: Unknown member description is missing the word "type"
  • Page 76: Procedure said to access rather than enumerate drives
  • Page 81: The term "Added" is used in place of "Created, Deleted"
  • Page 83: Drive referred to in place of folder
  • Page 83: The term "include" used in place of "using" in Step 2
  • Page 84: Incorrect direction in step 6
  • Page 85: EnableRaisingEvents property referred to as EnablingRaisingEvents
  • Page 89, Incorrect namespaces used in stream types.
  • Page 91: Suggestion that files can be created when read
  • Page 92: Incorrect description of the functionality of the Directory class
  • Page 92: Description of OpenWrite method is incorrect
  • Page 97: "read" used in place of "write"
  • Page 100, Incorrect basic functionality description of StreamWriter class
  • Page 104: Incorrect description of the behavior of the sample code
  • Page 111: The term "include" used in place of "using" in Step 2
  • Page 111: Incorrect instruction in step 3 of Excercise 1
  • Page 112: Class referred to in place of object
  • Page 115: The descriptions of the CanRead property is incorrect
  • Page 120: CompressionMode.Compress used in place of CompressionMode.Decompress
  • Page 121: The term "include" used in place of "using" in Step 2
  • Pages 121 & 122: Code samples are incorrect for Step 7
  • Page 122, Step 9: Additional note needs to be added.
  • Page 127: Term "file" used in place of "directory"
  • Page 129: Incorrect definition for IsolatedStorageFileStream
  • Page 133: Files referenced in place of directories
  • Page 135: The term "include" used in place of "using" in Step 2
  • Page 135: Object referenced in place of class
  • Page 135: Incorrect Visual Basic code in step 3
  • Page 136: Incorrect Visual Basic code in steps 4 and 5
  • Page 137: Sample code missing
  • Page 139: Clarification of data in 4th bullet down under Chapter Summary
  • Page 140: Incorrect description of Case Scenarios
  • Page 141: Machine-level data referred to as assembly data
  • Pages 145 & 146: Argument location is reversed
  • Page 146: TestRegExp command arguments partially incorrect
  • Page 165: IsZip method mentioned in place of ReformatPhone method
  • Page 170: "E." should be removed from answer E
  • Page 187: "or index" should be removed
  • Page 188: Class referenced in place of collection
  • Page 192: Missing newline in code sample
  • Page 192: "++x" should be "x++"

More information

CD-ROM: "not" should be removed from assessment question

In the Lesson Review on the CD-ROM, one of the questions is incorrect.

Change:
"Which item is not generally considered a shortcoming associated with using COM Interop?"

To:
"Which item is generally considered a shortcoming associated with using COM Interop?"

CD-ROM: Assessment answer should include ICollection and not IDictionaryEnumerator

In the Readiness Review assessment on the CDROM one of the questions reads:

"You are creating a new collection type that must be iterated using for-each loop. Which of the following interfaces should you implement? (Choose all that apply)
ICollection
IDictionaryEnumerator
IDictionary
IEnumerable
IEqualityCOmparer"

The assessment states that the answers are IDictionaryEnumerator and IEnumerator.

The correct answers are: ICollection and IEnumerator.

CD-ROM: Assessment answer should also include Resize event

In the Readiness Review Assessment, one of the questions reads:

"Which of the following are events for the System.Windows.Forms.Button class? (Choose three)
Serializing
Enter
MouseHover
Resize
Click
MosueOver"

The assessment states that the correct answers are: Enter, MouseHover, Click.

The assessment should also include the following answer as being correct: Resize.

CD-ROM: lesson3-exercise1-Person-partial code samples are missing from \Chapter01 folder

The Visual Basic and C# code samples "lesson3-exercise1-Person-partial" are missing from the \Code\Chapter01 folder. The folders and files are available for download from the Microsoft Download Center:

lesson3.exe (http://download.microsoft.com/download/c/d/a/cda2e6ee-9334-4dd9-901f-92be283d13b2/lesson3.exe)

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 (http://support.microsoft.com/kb/119591/EN-US/) How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

CD-ROM: Assessment qurestion scored incorrectly

In the Lesson Review on the CD-ROM, one of the questions is scored incorrectly.

The question reads:
"You are writing an application that needs to perform processing that will run for several hours. However, you need the application to remain responsive to the user during that time, so you are using multiple threads. Which of the following code samples would launch the thread in such a way as to minimize the impact on the performance of other applications? (Choose all that apply.)"

When the question is scored, one of the answers is marked correct, though it should be marked incorrect.

The answer reads:
'VB
Dim myThreadDelegate As New ThreadStart(AddressOf ThreasWork.DoWork)
Dim mtThread As New Thread(myThreadDelegate)
myThread.StartLowPriority()

// C#
ThreadStart myThreadDelegate = new ThreadStart(ThreadWork.DoWork);
Thread myThread = new Thread(myThreadDelegate);
myThread.StartLowPriority();

Page 3: System.Value referenced rather than System.ValueType

On page 3, the first sentence after the first bulleted list reads:

"Each of these types is derived from the System.Value base type."

It should read:

"Each of these types is derived from the System.ValueType base type."

Page 5: Date/date should be Date/none

On page 5, the first cell of the last row of Table 1-2 is incorrect.

Change:
"System.DateTime (Date/date)"

To:
"System.DateTime (Date/none)"

Page 5: 4 should be 1

On page 5, the Bytes column of the second row of Table 1-2 is incorrect.

Change:
"4"

To:
"1"

Page 9: NOTE is incorrect

On page 9, the NOTE reads:

"NOTE .NET 2.0
The Operator keyword is new in .NET 2.0."

This is incorrect and the note should be disregarded.

Page 12: Term "defines" used in place of "initializes" in step 4

On page 12, the first sentence of step 4 reads:

"Create a constructor that defines all three member variables, as the following code demonstrates:"

It should read:

"Create a constructor that initializes all three member variables, as the following code demonstrates:"

Page 14: Term "class" used in place of term "structure" in step 5

On page 14, the first sentence of step 5 reads:

"Modify your Main code to properly construct an instance of the Person class, as the following code sample demonstrates:"

It should read:

"Modify your Main code to properly construct an instance of the Person structure, as the following code sample demonstrates:"

Page 18: The word "variable" is missing from the final sentence

On page 18, the last sentence on the page reads:

"When you modify a reference type, you modify all copies of that reference type."

It should read:

"When you modify a reference type variable, you modify all copies of that reference type variable."

Page 24: C# code sample missing

On page 24, the following code sample should be added directly below the VB code sample:

// C#

try 
{
    StreamReader sr = new StreamReader("text.txt");
    Console.WriteLine(sr.ReadToEnd);
} 

catch (System.IO.FileNotFoundException ex) 
{
    Console.WriteLine("The file could not be found.");
} 

catch (System.UnauthorizedAccessException ex)
{
    Console.WriteLine("You do not have sufficient permissions.");
}

catch (Exception ex) 
{
    Console.WriteLine("Error reading file: " + ex.Message);
}


Page 25: Incorrect code in C# example

On page 25, the first three lines of the VB code sample read:

Dim sr As StreamReader = New StreamReader("text.txt")
Try
	Console.WriteLine(sr.ReadToEnd)

They should read:

Dim sr As StreamReader
Try
	sr = New StreamReader("text.txt")
	Console.WriteLine(sr.ReadToEnd)"

The first three lines of the C# code sample read:
"StreamReader sr = new StreamReader("text.txt");
try
{
	Console.WriteLine(sr.ReadToEnd());"

They should read:
"StreamReader sr;
try
{
	sr = new StreamReader("text.txt");
	Console.WriteLine(sr.ReadToEnd());

Page 46: Correction in code example

On page 46, the C# code example under the third bullet point is incorrect.

Change:
// C#
MyEventHandler handler = MyEvent;

EventArgs e = new EventArgs();

if (handler != null)
{
	// Invokes the delegates.
	handler(this, e);
}
// Note that C# checks to determine whether handler is null.
// This is not necessary in Visual Basic

To:
// C#
EventArgs e = new EventArgs();

if (MyEvent != null)
{
	// Invokes the delegates.
	MyEvent(this, e);
}
// Note that C# checks to determine whether handler is null.
// This is not necessary in Visual Basic


Page 47: "Guide" used in place of "Guid"

On page 47, the first sentence of the second paragraph from the bottom contains an incorrect attribute.

Change:
"Visual Studio automatically creates some standard attributes for your assembly when you create a project, including a title, description, company, guide, and version."

To:
"Visual Studio automatically creates some standard attributes for your assembly when you create a project, including a title, description, company, guid, and version."

Page 49: Invalid character in VB code sample

On page 49, the VB code sample contains an invalid bracket character.

Change:
' VB
Imports System.Runtime.CompilerServices
<Assembly:TypeForwardedTo(GetType(DestLib.TypeA))]>

To:
' VB
Imports System.Runtime.CompilerServices
<Assembly:TypeForwardedTo(GetType(DestLib.TypeA))>

Page 49: VB code sample missing Person class

On page 49, the second VB code sample near the bottom of the page is missing "Inherits Person".

Change:
' VB
Class Manager
End Class

To:
' VB
Class Manager : Inherits Person
End Class

Page 51: Methods incorrectly named

On page 51, in step 4 the code samples read:

'VB
Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) _'

and

//C#
private void Timer_Shown(object sender, EventArgs e)


They should read:

'VB
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _'

and

//C#
private void Form1_Load(object sender, EventArgs e)


Page 52: "progressBar" used in place of "progressBar1" in code sample

On page 52, a 1 needs to be added to "progressBar" in the first C# code sample at the top of the page.

Change:
// C#
void t_Tick(object sender, EventArgs e)
{
progressBar.Value += 10;
if (progressBar.Value >= 100)
t.Stop();
}

To:
// C#
void t_Tick(object sender, EventArgs e)
{
progressBar1.Value += 10;
if (progressBar1.Value >= 100)
t.Stop();
}


Page 55: Incorrect description of narrowing conversion behavior

On page 55, the sentence at the bottom of the page reads:

"Narrowing conversions fail if the source value exceeds the destination type's range or if a conversion between the types is not defined, so you should enclose a narrowing conversion in Try blocks or use TryCast or TryParse and check the return value."

It should read:

"Narrowing conversions may return an incorrect result if the source value exceeds the destination type's range. If a conversion between the types is not defined you will receive a compile-time error."

Page 58: Incorrect index used in the second code sample

On page 58, the last line of the second VB code sample reads:

Console.WriteLine("a = {0}, i = {0}", a.ToString, i.ToString)

It should read:

Console.WriteLine("a = {0}, i = {1}", a.ToString, i.ToString)

The last line of the C# code sample reads:

Console.WriteLine("a = {0}, i = {0}", a.ToString(), i.ToString());

It should read:

Console.WriteLine("a = {0}, i = {1}", a.ToString(), i.ToString());


Page 59: Decimal used in place of Double in code for Exercise 1

On page 59, in the third line of VB code in the second step of Exercise 1 reads:

Dim db As Decimal = 1

It should read:

Dim db As Double = 1


Page 63: "narrowing" used in place of "widening"

On page 63, the third sentence of the first paragraph reads:

"C# allows implicit conversion for only narrowing conversions, where no information could be lost."

It should read:

"C# allows implicit conversion for only widening conversions, where no information could be lost."

Page 72: "Exist property" referenced in place of "Exists property"

On page 72, the first sentence after the bulleted list reads:

"For example, you can check whether a file exists by calling the FileInfo object’s Exist property, as shown in the following code:"

It should read:

"For example, you can check whether a file exists by calling the FileInfo object’s Exists property, as shown in the following code:"

Page 73: string should be DirectoryInfo object

On page 73, the Description of Root in Table 2-5 is incorrect.

Change:
"Gets the root part of the directory’s path as a string"

To:
"Gets the root part of the directory’s path as a DirectoryInfo object"

Page 74: DriveInfo class described incorrectly

On page 74, the first sentence under the DriveInfo class section reads:

“The DriveInfo class provides the basic functionality to access and manipulate a single directory in the file system.”

It should read:

"The DriveInfo class models a drive and provides methods and properties to query for drive information. Use DriveInfo to determine what drives are available, and what type of drives they are. You can also query to determine the capacity and available free space on the drive."

Page 76: Unknown member description is missing the word "type"

On page 76, the description of the Unknown member in Table 2-9 reads:

"The drive could not be determined."

It should read:

"The drive type could not be determined."

Page 76: Procedure said to access rather than enumerate drives

On page 76, the first sentence of the How to Enumerate Drives section reads:

"You follow this procedure to access the drives in a system:"

It should read:

"You follow this procedure to enumerate all the drives in a system:"

Page 81: The term "Added" is used in place of "Created, Deleted"

On page 81, the first sentence of the second paragraph reads:

"In addition to using the Added and Changed events, you can monitor the system for renamed files."

It should read:

"In addition to using the Created, Deleted and Changed events, you can monitor the system for renamed files."

Page 83: Drive referred to in place of folder

On page 83, the first sentence of Excercise 1 reads:

"In this exercise, you will enumerate through all the files in a particular drive."

It should read:

"In this exercise, you will enumerate through all the files in a particular folder."

Page 83: The term "include" used in place of "using" in Step 2

On page 83, step 2 reads:

"Add an Import (or an include in C#) for the System.IO namespace into the new project."

It should read:

"Add an Import (or aa using statement in C#) for the System.IO namespace into the new project."

Page 84: Incorrect direction in step 6

On page 84, the first sentence of step 6 reads:

"In the Main method, write code to create a new instance of a DirectoryInfo object for the Windows directory and use it to call the new ShowDirectory method."

It should read:

"In the Main method, write code to create a new instance of a DirectoryInfo class for the System directory and use it to call the new ShowDirectory method."

Page 85: EnableRaisingEvents property referred to as EnablingRaisingEvents

On page 85, step 7 reads:

"Set the EnablingRaisingEvents property to true to tell the watcher object to start throwing events."

It should read:

"Set the EnableRaisingEvents property to true to tell the watcher object to start throwing events."

Page 89, Incorrect namespaces used in stream types.

On page 89, the 3rd, 4th and 5th bullet points read:

"* CryptoStream (System.Security)
* NetworkStream (System.Net)
* GZipStream (System.Compression)"

They should read:

"* CryptoStream (System.Security.Cryptography)
* NetworkStream (System.Net.Sockets)
* GZipStream (System.IO.Compression)"

Page 91: Suggestion that files can be created when read

On page 91, the first bullet point reads:

"Operations to create or open files for reading"

It should read:

"Operations to open files for reading"

Page 92: Incorrect description of the functionality of the Directory class

On page 92, the second sentence of the Directory Class section reads:

"The Directory class provides the basic functionality to open file streams for reading and writing."

It should read:

"The Directory class provides the basic functionality to create, manage, delete, and analyze directories."

Page 92: Description of OpenWrite method is incorrect

On page 92, the Description for the OpenWrite method reads:

"Opens an existing file for writing and returns a StreamWriter object."

It should read:

"Opens an existing file for writing and returns a FileStream object."

Page 97: "read" used in place of "write"

On page 97, the first sentence of the first paragraph reads:

"The StreamReader class provides the basic functionality to write data from a Stream derived class."

It should read:

"The StreamReader class provides the basic functionality to read data from a Stream derived class."

Page 100, Incorrect basic functionality description of StreamWriter class

On page 100, the first sentence of the first paragraph reads:

"The StreamWriter class provides the basic functionality to read data from a Stream derived class."

It should read:

"The StreamWriter class provides the basic functionality to write data from a Stream derived class."

Page 104: Incorrect description of the behavior of the sample code

On page 104, the last sentence on the page reads:

"For example, the following code will read the code just shown:"

It should read:

"For example, the following code will read the data written by the code just shown:"

Page 111: The term "include" used in place of "using" in Step 2

On page 111, step 2 reads:

"Add an Import (or an include in C#) for the System.IO namespace into the new project."

It should read:

"Add an Import (or aa using statement in C#) for the System.IO namespace into the new project."

Page 111: Incorrect instruction in step 3 of Excercise 1

On page 111, step 3 of Exercise 1 reads:

"In the Main method, create a new StreamWriter from the Create method of the File class."

It should read:

"In the Main method, create a new StreamWriter by calling the CreateText method of the File class."

Page 112: Class referred to in place of object

On page 112, step 2 of Exercise 2 reads:

"In the Main method after the StreamWriter class is closed, open the file using the OpenText method of the File class to create a new StreamReader object."

It should read:

"In the Main method after the StreamWriter object is closed, open the file using the OpenText method of the File class to create a new StreamReader object."

Page 115: The descriptions of the CanRead property is incorrect

On page 115, the description of the CanRead property in Table 2-30 reads:

"Determines whether the stream supports reading while decompressing a file. (Inherited from the Stream class.)"

It should read:

"Determines whether the stream supports reading. (Inherited from the Stream class.)"

Page 120: CompressionMode.Compress used in place of CompressionMode.Decompress

On page 120, the first full code sample read:

' VB 
Dim compStream As _ 
    New GZipStream(sourceFile, CompressionMode.Compress) 
 
// C# 
GZipStream compStream =  
    new GZipStream(sourceFile, CompressionMode.Compress);

It should read:

' VB 
Dim compStream As _
    New GZipStream(sourceFile, CompressionMode.Decompress)

 // C#
GZipStream compStream = 
    new GZipStream(sourceFile, CompressionMode.Decompress);


Page 121: The term "include" used in place of "using" in Step 2

On page 121, step 2 reads:

"Add an Import (or an include in C#) for the System.IO namespace into the new project."

It should read:

"Add an Import (or aa using statement in C#) for the System.IO namespace into the new project."

Pages 121 & 122: Code samples are incorrect for Step 7

On pages 121 & 122, Exercise 1, Step 7, the VB and C# code samples are incorrect. When used in the exercise, they do not create a smaller compressed file.

Change:
' VB
Dim theByte As Integer = sourceFile.ReadByte()
While theByte <> -1
    compStream.WriteByte(CType(theByte, Byte))
    theByte = sourceFile.ReadByte()
End While

// C#
int theByte = sourceFile.ReadByte();
while (theByte != -1)
{
    compStream.WriteByte((byte)theByte);
    theByte = sourceFile.ReadByte();
}

To:
' VB
Dim buffer(sourceFile.Length) As Byte
        sourceFile.Read(buffer, 0, buffer.Length)
        compStream.Write(buffer, 0, buffer.Length)

// C#
const int buf_size = 4096;
byte[] buffer = new byte[buf_size];
int bytes_read = 0;
do
{
    bytes_read = sourceFile.Read(buffer,0,buf_size);
    compStream.Write(buffer,0,bytes_read);
} while (bytes_read != 0);

Page 122: Additional note needs to be added for step 9.

On Page 122, Step 9 an addition NOTE needs to be added before the code sample for more information:

"NOTE: Using a small file may result in the compressed file being larger than the original because of the overhead of compression. If you use a larger file, the size of the overhead will not cause such a pallor on the size of the resulting file."

Page 127: Term "file" used in place of "directory"

On page 127, the description of GetDirectoryNames in Table 2-36 reads:

"Gets a list of directory names within the store that match a file mask"

It should read:

"Gets a list of directory names within the store that match a directory mask"

Page 129: Incorrect definition for IsolatedStorageFileStream

On page 129, the first sentence of the first paragraph reads:

"The IsolatedStorageFileStream class encapsulates a stream that is used to create files in isolated storage."

It should read:

"The IsolatedStorageFileStream class encapsulates a stream that is used to read, write and create files in isolated storage."

Page 133: Files referenced in place of directories

On page 133, the paragraph before the final code sample reads:

"Directories are treated much like files in that to test for their existence, you must use a method that returns an array of strings that match a file mask. The GetDirectoryNames method of the IsolatedStorageFile class allows you to find an existing file before you try to create it:"

It should read:

"Directories are treated much like files in that to test for their existence, you must use a method that returns an array of strings that match a mask. The GetDirectoryNames method of the IsolatedStorageFile class allows you to find an existing directory before you try to create it:"

Page 135: The term "include" used in place of "using" in Step 2

On page 135, step 2 reads:

"Add an Import (or an include in C#) for the System.IO namespace into the new project."

It should read:

"Add an Import (or aa using statement in C#) for the System.IO namespace into the new project."

Page 135: Object referenced in place of class

On page 135, the first sentence of step 3 in Exercise 1 reads:

"In the Main method of the new project, create a new instance of the IsolatedStorageFile object named userStore that is scoped to the current user and assembly."

It should read:

"In the Main method of the new project, create a new instance of the IsolatedStorageFile class named userStore that is scoped to the current user and assembly."

Page 135: Incorrect Visual Basic code in step 3

On page 135, the Visual Basic code in step 3 reads:

' VB 
IsolatedStorageFile userStore = _ 
    IsolatedStorageFile.GetUserStoreForAssembly()

It should read:

' VB
Dim userStore as IsolatedStorageFile = _
    IsolatedStorageFile.GetUserStoreForAssembly()


Page 136: Incorrect Visual Basic code in steps 4 and 5

On page 136, the Visual Basic code in step 4 reads:

' VB 
IsolatedStorageFileStream userStream = new _  
    IsolatedStorageFileStream("UserSettings.set", _ 
                              FileMode.Create, _  
                              userStore) 


It should read:

' VB
Dim userStream as IsolatedStorageFileStream = new _ 
    IsolatedStorageFileStream("UserSettings.set", _
                              FileMode.Create, _ 
                              userStore)


The code in step 5 reads:

' VB 
StreamWriter userWriter = new StreamWriter(userStream) 
userWriter.WriteLine("User Prefs") 
userWriter.Close() 


It should read:

' VB
Dim userWriter as new StreamWriter(userStream)
userWriter.WriteLine("User Prefs")
userWriter.Close()


Page 137: Sample code missing

On page 137, the fifth line of the first section of sample code reads:

// ...

It should read:

Console.WriteLine("No data saved for this user.");


Page 139: Clarification of data in 4th bullet down under Chapter Summary

On page 139, fourth bullet down under Chapter Summary it reads:

"The StreamReader and StreamWriter classes are instrumental in dealing with moving data into and out of streams, including FileStreams, MemoryStreams, and IsolatedStorageFileStreams."

It should read:

"The StreamReader and StreamWriter classes are instrumental in dealing with moving textoriented data into and out of streams, including FileStreams, MemoryStreams, and IsolatedStorageFileStreams."

Page 140: Incorrect description of Case Scenarios

On page 140, the first sentence of the Case Scenarios section reads:

"In the following case scenarios, you will apply what you’ve learned about how to use application domains and services."

It should read:

"In the following case scenarios, you will apply what you’ve learned about files and directories."

Page 141: Machine-level data referred to as assembly data

On page 141, the Create a Simple Configuration Storage section reads:

"For this task, you should complete at least Practices 1 and 2. To understand how user and assembly data differ in isolated storage, complete Practice 3 as well.

- Practice 1 Create a Windows Forms application that allows users to save data and store it in isolated storage.
- Practice 2 Test the Windows Forms application by running it under different user accounts.
- Practice 3 Modify the application to store some assembly-level data to see whether that data is the same for all users."

It should read:

"For this task, you should complete at least Practices 1 and 2. To understand how user and machine-level data differ in isolated storage, complete Practice 3 as well.

- Practice 1 Create a Windows Forms application that allows users to save data and store it in isolated storage.
- Practice 2 Test the Windows Forms application by running it under different user accounts.
- Practice 3 Modify the application to store some machine-level data to see whether that data is the same for all users."

Pages 145 & 146: Argument location is reversed

On page 145, line 7 of the VB code example and on page 146 line 11 of the C# code example contain incorrect argument locations.

Change (page 145 VB):
If Regex.IsMatch(args(1),args(0)) Then

To:
If Regex.IsMatch(args(0),args(1)) Then

Change (page 146 C#):
if (Regex.IsMatch(args[1], args[0]))

To:
if (Regex.IsMatch(args[0], args[1]))

Page 146: TestRegExp command arguments partially incorrect

On page 146, the two command line and expected output samples under the 1st paragraph are partially incorrect.

Change:
C:\>TestRegExp ^\d{5}$ 1234
Input DOES NOT match regular expression.
C:\>TestRegExp ^\d{5}$ 12345
Input matches regular expression.

To:
C:\TestRegExp 1234 ^^\d{5}$
Input DOES NOT match regular expression.
(Note: You need to add another ^ because the command line interprets ^ as an escape character. The second ^ is not necessary when adding command line arguments directly through the Visual Studio Command Line Project Properties - Debug - Command Line arguments.)
C:\TestRegExp 12345 ^^\d{5}$
Input matches regular expression.

Page 165: IsZip method mentioned in place of ReformatPhone method

On page 165, the last sentence before the code sample in step 3 of Exercise 2 reads:

"Though many different regular expressions would work, the IsZip method you write could look like this:"

It should read:

"Though many different regular expressions would work, the ReformatPhone method you write could look like this:"

Page 170: "E." should be removed from answer E

On page 170, Question 4, Answer E reads:

"E. amomomottohez"

It should read:

"amomomottohez"

Page 187: "or index" should be removed

On page 187, there are errors in the descriptions of Hashtable and StringDictionary.

Change:
"Hashtable A collection of name/value pairs of objects that allows retrieval by name or index"

To:
"Hashtable A collection of name/value pairs of objects that allows retrieval by name"

Change:
"StringDictionary A collection of name/values pairs of strings that allows retrieval by name or index"

To:
"StringDictionary A collection of name/values pairs of strings that allows retrieval by name"

Page 188: Class referenced in place of collection

On page 188, the second sentence of the Adding and Removing Items section reads:

"Adding items to and removing items from the class is very straightforward."

It should read:

"Adding items to and removing items from the collection is very straightforward."

Page 192: Missing newline in code sample

On page 192, the seventh line of the second code sample reads:

// C# IEnumerator enumerator = coll.GetEnumerator();

It should read:

// C# 
IEnumerator enumerator = coll.GetEnumerator();


Page 192: "++x" should be "x++"

On page 192, the second line of the first code sample on the page is incorrect.

Change:
for (int x = 0; x < coll.Count; ++x)

To:
for (int x = 0; x < coll.Count; x++)

Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.
Keywords: 
KB923018
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support