????? ??????? Self-Paced MCTS (???????? 70 536): Microsoft ® .NET Framework 2.0 ? ????????? Foundation ????? ??????? ???????? ????? ?????

?????? ????????? ?????? ?????????
???? ???????: 923018 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ??? ??????? ????????? ???????? ??? ????? ???????? ???????? ???? Microsoft Press ?????? ??????? Self-Paced MCTS (???????? 70 536): Microsoft ® .NET Framework 2.0 ? Foundation ????? ??????? ? 978-0-7356-2277-7.????? ??????? ?????? ????? ??? ??????? 935218949730 ? 949734.

??? ????? ???????? ???????:

  • ????????: "???" ??? ????? ?? ???? ???????
  • ????????: ????? ???????? ??? ?? ????? ICollection IDictionaryEnumerator ??
  • ????????: ????? ???????? ??? ?? ????? ????? ????? ????? ?????
  • ????????: ????? ???????? ???????? lesson3-exercise1-????? - ?????? ?????? ?? ?????? \Chapter01
  • ????????: ????? qurestion ????? ???? ??? ????
  • ???? 3: ??? ??????? ????? ????? ?? System.ValueType System.Value
  • 5 ??????: ??? ?? ???? ???????/????? ??????? / ???
  • ??? ?? ???? ???? 5: 4 1
  • 9 ??????: ?????? ??? ????
  • ???? 12: ????? "?????" ????????? ???? "?????" ?? ?????? 4
  • 14 ??????: ????? "?????" ????????? ???? ??????? "????" ?? ?????? 5
  • 18 ??????: ???? "?????" ????? ?? ?????? ???????
  • 24 ??????: C# ??? ???? ??????
  • 25 ??????: ????????? ???????? ??? ????? ?? C# ??????
  • 46 ??????: ????? ?? ?????? ????????? ????????
  • ?? ??????: "??????" ????????? ???? "??????"
  • 49 ??????: ??? ??? ???? ?? ????? ????????? ???????? VB
  • 49 ??????: ????? ????????? ???????? VB ??? ????? ?????
  • 51 ??????: ?????? ???? ???? ??? ????
  • 52 ??????: "progressBar" ????????? ???? "progressBar1" ?? ????? ????????? ????????
  • 55 ??????: ????? ???? ??????? ??? ??? ????
  • 58 ??????: ???? ??? ???? ?????? ?? ????? ????????? ???????? ??????
  • 59 ??????: ??????? ????? ?? ????? ?? ????????? ???????? ?? 1 ??????? ???????
  • 63 ??????: "?????" ????????? ???? "?????"
  • 72 ??????: "???? ?????" ?????? ????? ????? ?? "????? ???????"
  • 73 ??????: ??? ?? ???? ????? DirectoryInfo ??????
  • 74 ??????: ??? DriveInfo ????? ???? ??? ????
  • 76 ??????: ????? ??? ??? ??? ????? ?????? "?????"
  • 76 ??????: ???? ????? ?????? ????? ?? ????? ?????? ???????
  • 81 ??????: ??????? "???????" ??? ???????? ????? ?? "?????, ????????"
  • 83 ??????: ???? ??????? ??? ????? ?? ??????
  • 83 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????
  • 84 ??????: ????? ??? ????? ?? ?????? 6
  • 85 ??????: ??????? EnableRaisingEvents ????? ????? EnablingRaisingEvents
  • 89 ?????? ???????? ?? ????? ??? ?????? ????? ??? ?????.
  • 91 ??????: ?????? ????? ???? ????? ??? ?????
  • 92 ??????: ??? ????? ??? ?????? ??? ????
  • 92 ??????: ??? OpenWrite ????? ??? ????
  • 97 ??????: "?????" ????????? ???? "???????"
  • 100 ???? ??? ??????? ???????? ??? ???? ????? StreamWriter
  • 104 ??????: ??? ???? ????? ???????? ???????? ??? ????
  • 111 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????
  • 111 ??????: ???????? ??? ????? ?? ?????? 3 ? Excercise 1
  • 112 ??????: ??? ??????? ??? ????? ?? ??????
  • 115 ??????: ??? ??????? CanRead ??? ????
  • 120 ??????: ??????? ????? ?? CompressionMode.Decompress CompressionMode.Compress
  • 121 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????
  • ????? 121 & 122: ????? ??????? ?????? ??? ????? ?? ?????? 7
  • 122 ?????? ? ???? 9: ????? ?????? ?????? ???? ??????.
  • 127 ??????: ????? "???" ????????? ???? "????"
  • 129 ??????: ????? IsolatedStorageFileStream ??? ????
  • 133 ??????: ??? ??????? ????? ????? ?? ????? ?????
  • 135 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????
  • 135 ??????: ??? ??????? ????? ????? ?? ??? ????
  • 135 ??????: ????????? ???????? ?? Visual Basic ??? ???? ?? ?????? 3
  • 136 ??????: ????????? ???????? ?? Visual Basic ??? ???? ?? ???????? 4 ? 5
  • 137 ??????: ????? ????????? ???????? ??? ?????
  • 139 ???????: ????? ?? ???????? ?? ????? ?????? ?????? ??? ?????? ??? "???? ?????"
  • 140 ??????: ??? "?????????? ????" ??? ?????
  • 141 ??????: ???????? ????? ?????? ????? ??? ?????? ???????
  • ????? 145 & 146: ???? ????? ?????
  • 146 ??????: ???????? ????? TestRegExp ?????? ??? ?????
  • 165 ??????: ???????? ????? ?? ????? ReformatPhone ????? IsZip
  • 170 ??????: ??? ????? "???" ?? ???????? E
  • 187 ??????: "?? ?????" ??? ?????
  • 188 ??????: ??? ??????? ????? ????? ?? ?????? ???
  • 192 ??????: ????? ????? ?????? ?? ????? ????????? ????????
  • 192 ??????: "++ x"??? ?? ????"x ++"

??????? ????

????????: "???" ??? ????? ?? ???? ???????

?? "?????? ?????" ??? ????? ??????? ???? ??????? ??? ?????.

?????:
"?????? ???? ?? ??? ????? shortcoming ???????? ???????? Interop COM ?"

???:
"?????? ???? ??? ????? shortcoming ???????? ???????? Interop COM ?"

????????: ????? ???????? ??? ?? ????? ICollection IDictionaryEnumerator ??

???? ?? ????? "?????? ????????" ??? CDROM ??? ???????:

"??? ????? ??? ?????? ????? ??? ?? ???? iterated ???????? ????? ???? ??- ???. ?? ?? ???????? ??????? ??? ????? ? (???? ???? ?????)
ICollection
IDictionaryEnumerator
IDictionary
IEnumerable
IEqualityCOmparer"

??? ??????? ?? ???????? ????? IDictionaryEnumerator IEnumerator.

???????? ???????: ICollection ? IEnumerator.

????????: ????? ???????? ??? ?? ????? ????? ????? ????? ?????

???? ?? "????? ?????? ????????" ??? ???????:

"?? ??? ??? ???? ????? ???? System.Windows.Forms.Button ? (???? ?????)
????? ?????
????
MouseHover
????? ???
???? ???
MosueOver"

???? ??????? ???????? ???????: ????, MouseHover ? ?????.

??? ?? ????? ??????? ????? ???????? ??????? ??? ??????: ????? ?????.

????????: ????? ???????? ???????? lesson3-exercise1-????? - ?????? ?????? ?? ?????? \Chapter01

????? ????????? ???????? Visual Basic ? C# "lesson3 - exercise1-????? - ?????" ?????? ?? ?????? \Code\Chapter01. ??????? ????????? ?????? ??????? ?? "???? ??????? ?? Microsoft":

lesson3.exe

?????? ??? ??????? ?????? ??? ????? ????? ????? ??? Microsoft "? ???? ??? ??? ??????? ?????? ?????? ??" ????? ??????? ?? Microsoft:

119591????? ?????? ??? ????? ??? Microsoft ?? ??????? ??? ????????

???? Microsoft ???? ??? ????? ????? ?? ?????????. ??????? Microsoft ???? ?? ?????? ??? ??????? ??????? ??? ??????? ???? ?? ??? ?????. ??? ????? ????? ??? ?????? ????? ?????? ???? ????? ??? ??? ????? ??? ??????? ??? ???? ??? ??? ?????.

????????: ????? qurestion ????? ???? ??? ????

?? "?????? ?????" ??? ????? ??????? ??? ??????? ??? ????? ???? ??? ????.

???? ??????:
"??????? ??? ??????? ???? ????? ??? ????? ?????? ???? ????? ?????? ??? ?????. ??? ???? ????? ??? ???? ??????? ???????? ????? ??? ????? ??? ?? ???? ??????? ?????? ????? ?????? ???????. ?? ?? ????? ???????? ???????? ??????? ??? ????? ???? ????? ?? ????? ?????? ??????? ??? ???? ????????? ?????? ? (???? ???? ?????.)"

????? ??? ????? ?????? ??? ???????? ?? ??? ????? ????? ?????? ?? ??? ??? ??? ????? ??? ?????.

???? ???????:
'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();

???? 3: ??? ??????? ????? ????? ?? System.ValueType System.Value

?? ?????? 3 ? ???? ?????? ????? ??? ??????? ??? ??????? ?????? ?????:

"?? ?? ??? ??????? ???? ?? ????? ??????? System.Value."

??? ?????:

"?? ?? ??? ??????? ???? ?? ????? ??????? System.ValueType."

5 ??????: ??? ?? ???? ???????/????? ??????? / ???

?? ?????? 5 ??? ???? ?? ???? ?????? ?? ???? 1-2 ??? ?????.

?????:
"System.DateTime (?????/?????)"

???:
"System.DateTime (????? / ???)"

??? ?? ???? ???? 5: 4 1

?? ?????? 5 ?????? ???? ?? ???? ?????? ?? ???? 1-2 ??? ?????.

?????:
"4"

???:
"1"

9 ??????: ?????? ??? ????

?? ?????? 9 ? ???? ??????:

"?????? .net 2.0
?????? ???????? ???? ??????? ?????? ?? .NET 2.0."

??? ??? ???? ??? ?????? ?? ???? ????????.

???? 12: ????? "?????" ????????? ???? "?????" ?? ?????? 4

?? ?????? 12 ? ???? ?????? ?????? ?? ?????? 4:

"????? ????? ????? ???? ??????? ??????? ????? ??? ???? ???????? ???????? ???????:"

??? ?????:

"????? ????? ????? ???? ??????? ??????? ????? ??? ???? ???????? ???????? ???????:"

14 ??????: ????? "?????" ????????? ???? ??????? "????" ?? ?????? 5

?? ?????? 14 ? ???? ?????? ?????? ?? ?????? 5:

"????? ????????? ???????? ??????? ?????? ???? ??? ????? ???? ???? ??? ???? ????? ????????? ???????? ??????:"

??? ?????:

"????? ????????? ???????? ??????? ?????? ???? ???? ????? ???? ???? ??? ???? ????? ????????? ???????? ??????:"

18 ??????: ???? "?????" ????? ?? ?????? ???????

?? ?????? 18 ? ???? ?????? ??????? ??? ??????:

"??? ????? ??? ???? ????? ????? ???? ????? ?? ??? ????? ??????."

??? ?????:

"??? ????? ????? ??? ???? ????? ????? ???? ??? ??? ????? ??? ????."

24 ??????: C# ??? ???? ??????

?? ?????? 24 ? ??? ????? ????? ????????? ???????? ?????? ??????? ???? ????? ????????? ???????? VB:

// 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);
}


25 ??????: ????????? ???????? ??? ????? ?? C# ??????

?? ?????? 25 ????? ?????? ??????? ?????? ?? ????? ????????? ???????? VB:

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

??? ????? ???:

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

???? ?????? ??????? ?????? ?? C# ??????? ?????:
"StreamReader sr = new StreamReader("text.txt");
try
{
	Console.WriteLine(sr.ReadToEnd());"

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

46 ??????: ????? ?? ?????? ????????? ????????

?? ?????? 46 ?????? ??? C# ??? ???? ?????? ??? ????.

?????:
// 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

???:
// 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


?? ??????: "??????" ????????? ???? "??????"

?? ?????? 47 ?????? ????? ?? ?????? ?????? ?? ?????? ????? ??? ??? ??? ?????.

?????:
"Visual Studio ???????? ????? ??? ?????? ???????? ??????? ????? ?? ??? ????? ????? ??? ?? ??? ??????? ? ??? ? ??????, ?????? ? ???????."

???:
"Visual Studio ???????? ????? ??? ?????? ???????? ??????? ????? ?? ??? ????? ????? ??? ?? ??? ??????? ? ??? ? ??????, ?????? ?????? ??????? ? ???????."

49 ??????: ??? ??? ???? ?? ????? ????????? ???????? VB

?? ?????? 49 ????? ????????? ???????? VB ????? ??? ??? ??? ??? ????.

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

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

49 ??????: ????? ????????? ???????? VB ??? ????? ?????

?? ?????? 49 ????? ?? ????? ????????? ???????? VB ?????? ?????? ?? ???? ?????? "??? ???".

?????:
' VB
Class Manager
End Class

???:
' VB
Class Manager : Inherits Person
End Class

51 ??????: ?????? ???? ???? ??? ????

??? ???? 51 ?? ?????? 4 ????? ???????? ???????? ?????:

'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)


??? ????? ???:

'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)


52 ??????: "progressBar" ????????? ???? "progressBar1" ?? ????? ????????? ????????

?? ?????? 52 ???????? 1 ?????? ??????? ??? "progressBar" ?? ??? C# ??? ??????? ?? ?????? ??????.

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

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


55 ??????: ????? ???? ??????? ??? ??? ????

?? ?????? 55 ? ???? ?????? ?? ???? ??????:

"????? ??????? ????? ??? ?????? ???? ???? ???? ??? ?????? ?? ??? ?? ??? ????? ??? ??????? ?????, ??? ??? ????? ????? ????? ?????? ?? ???? ??? ?? ??????? TryCast ?? TryParse ? ?????? ?? ???? ???????."

??? ?????:

"????? ??????? ?? ?????? ????? ??? ????? ??? ?????? ???? ???? ???? ??? ??????. ??? ?? ??? ????? ????? ??? ??????? ?????? ??? ??? ??????? ???????."

58 ??????: ???? ??? ???? ?????? ?? ????? ????????? ???????? ??????

?? ?????? 58 ? ???? ????? ?????? ?? ????? ????????? ???????? VB ??????:

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

??? ?????:

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

???? ????? ?????? ?? ????? ????????? ???????? ?? C#:

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

??? ?????:

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


59 ??????: ??????? ????? ?? ????? ?? ????????? ???????? ?? 1 ??????? ???????

?? ?????? 59 ?? ??????? ??? ?? ????????? ???????? VB ?? ?????? ??????? 1 ??????? ????:

Dim db As Decimal = 1

??? ?????:

Dim db As Double = 1


63 ??????: "?????" ????????? ???? "?????"

?? ?????? 63 ? ???? ?????? ?????? ?? ?????? ??????:

"C# ?????? ??????? ?????? ?????? ??? ????? ??????? ? ??? ?? ???? ?? ??? ????? ?????????."

??? ?????:

"C# ?????? ??????? ?????? ?????? ??? ????? ??????? ? ??? ?? ???? ?? ??? ????? ?????????."

72 ??????: "???? ?????" ?????? ????? ????? ?? "????? ???????"

?? ?????? 72 ? ???? ?????? ????? ??? ??????? ??? ??????? ??????:

"??? ???? ??????? ????? ??? ?? ??? ??? ???? ??? ?? ???? ??????? ??????? ???? ???? FileInfo ? ??? ?? ???? ?? ????????? ???????? ???????:"

??? ?????:

"??? ???? ??????? ????? ??? ?? ??? ??? ???? ??? ?? ???? ??????? ???? FileInfo ????? ???????? ??? ?? ???? ?? ????????? ???????? ???????:"

73 ??????: ??? ?? ???? ????? DirectoryInfo ??????

?? ?????? 73 "????? ?? ?????" ?? ???? 2-5 ??? ????.

?????:
"???? ??? ????? ?? ???? ?????? ??????"

???:
"???? ??? ????? ?? ???? ?????? ????? DirectoryInfo"

74 ??????: ??? DriveInfo ????? ???? ??? ????

?? ?????? 74 ? ???? ?????? ????? ??? ?????? ??? DriveInfo:

? ???? ????? DriveInfo ??? ??????? ???????? ?????? ??? ???? ???? ????????? ?? ???? ??????? ?.

??? ?????:

"??? DriveInfo ????? ????? ??? ???? ?????? ?????? ????????? ?? ??????? ???? ???????. ??????? DriveInfo ?????? ?????? ??????? ???? ????? ? ??? ??? ?? ?????? ???????. ????? ????? ????????? ?????? ??? ??????? ????? ??? ???? ???????."

76 ??????: ????? ??? ??? ??? ????? ?????? "?????"

?? ?????? 76 ? ???? ??? ????? ??? ????? ?? ???? 2-9:

"???? ????? ???? ???????."

??? ?????:

"???? ????? ??? ???? ???????."

76 ??????: ???? ????? ?????? ????? ?? ????? ?????? ???????

?? ?????? 76 ? ???? ?????? ?????? ?? ????? ?????? "????? ?????? ???????":

"???? ??? ??????? ?????? ??? ?????? ??????? ?? ????:"

??? ?????:

"???? ??? ??????? ????? ???? ?????? ??????? ?? ????:"

81 ??????: ??????? "???????" ??? ???????? ????? ?? "?????, ????????"

?? ?????? 81 ? ???? ?????? ????? ?? ?????? ??????:

"???????? ??? ??????? ??????? ?????? Changed ? ????? ?????? ???? ????? ??? ????? ??????."

??? ?????:

"???????? ??? ??????? ????? ???????" ? "?????" ? "Changed ? ????? ?????? ???? ????? ??? ????? ??????."

83 ??????: ???? ??????? ??? ????? ?? ??????

?? ?????? 83 ? ???? ?????? ????? Excercise 1:

"?? ??? ??????? ???? ??? ????? ??? ???? ??????? ?? ???? ????? ????."

??? ?????:

"?? ??? ??????? ???? ??? ????? ???? ??????? ?? ???? ????."

83 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????

?? ?????? 83 ? ???? ?????? 2:

"????? ????? ??????? (?? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

??? ?????:

"????? ??????? (?? aa ???????? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

84 ??????: ????? ??? ????? ?? ?????? 6

?? ?????? 84 ? ???? ?????? ?????? ?? ?????? 6:

"?? ??????? ??????? ????? ????????? ???????? ??? ????? ???? ???? ?? ?????? DirectoryInfo ????? Windows ???????? ??????? ??????? ShowDirectory ???????."

??? ?????:

"?? ??????? ??????? ????? ????????? ???????? ??? ????? ???? ???? ?? ??? DirectoryInfo ???? ?????? ???????? ??????? ??????? ShowDirectory ???????."

85 ??????: ??????? EnableRaisingEvents ????? ????? EnablingRaisingEvents

?? ?????? 85 ? ???? ?????? 7:

"????? ??????? EnablingRaisingEvents ??? true ?????? ???? ?????? ??? ??? ???????."

??? ?????:

"????? ??????? EnableRaisingEvents ??? true ?????? ???? ?????? ??? ??? ???????."

89 ?????? ???????? ?? ????? ??? ?????? ????? ??? ?????.

?? ?????? 89 ????? ???? ????? ?????? ?????? "?" ?????? "?" ???? ?? ?? 5:

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

??? ????? ???:

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

91 ??????: ?????? ????? ???? ????? ??? ?????

?? ?????? 91 ? ???? ???? ?????:

"?????? ????? ??????? ?? ????? ???????"

??? ?????:

"?????? ??? ????? ???????"

92 ??????: ??? ????? ??? ?????? ??? ????

?? ?????? 92 ? ???? ?????? ?????? ?? ?????? "??? ??????":

"??? ?????? ???? ??????? ???????? ???? ????? ???????? ?????? ??? ????? ??????."

??? ?????:

"??? ?????? ???? ??????? ???????? ????? ??????? ?????? ??? ????????."

92 ??????: ??? OpenWrite ????? ??? ????

?? ?????? 92 ? ???? ??? ????? OpenWrite:

"??? ??? ????? ??????? ? ?????? ???? StreamWriter."

??? ?????:

"??? ??? ????? ??????? ? ?????? ???? ???? FileStream."

97 ??????: "?????" ????????? ???? "???????"

?? ?????? 97 ? ???? ?????? ????? ?? ?????? ??????:

"??? StreamReader ???? ??????? ???????? ????? ???????? ?? ??? ????? ???."

??? ?????:

"??? StreamReader ???? ??????? ???????? ????? ???????? ?? ??? ??????? ???."

100 ???? ??? ??????? ???????? ??? ???? ????? StreamWriter

?? ?????? 100 ? ???? ?????? ????? ?? ?????? ??????:

"??? StreamWriter ???? ??????? ???????? ????? ???????? ?? ??? ??????? ???."

??? ?????:

"??? StreamWriter ???? ??????? ???????? ????? ???????? ?? ??? ????? ???."

104 ??????: ??? ???? ????? ???????? ???????? ??? ????

?? ?????? 104 ? ???? ?????? ??????? ??? ??????:

"??? ???? ??????? ????? ???????? ???????? ??????? ??? ????????? ???????? ??? ?????:"

??? ?????:

"??? ???? ??????? ???? ???????? ???????? ??????? ?? ????? ???????? ????? ?? ??????? ?? ??? ???????? ???????? ??? ?????:"

111 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????

?? ?????? 111 ? ???? ?????? 2:

"????? ????? ??????? (?? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

??? ?????:

"????? ??????? (?? aa ???????? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

111 ??????: ???????? ??? ????? ?? ?????? 3 ? Excercise 1

?? ?????? 111 ? ???? ?????? 3 ?? ??????? 1:

"?? ??????? ??????? ????? StreamWriter ????? ?? ??????? ????? ????? ???."

??? ?????:

"?? ??????? ??????? ????? StreamWriter ???? ?????? ??????? ??????? CreateText ????? ???."

112 ??????: ??? ??????? ??? ????? ?? ??????

?? ?????? 112 ? ???? ?????? 2 ?? ??????? 2:

"?? ??????? ??????? ??? ????? ??? StreamWriter ??? ????? ???????? ????? OpenText ??? ??? ????? ???? StreamReader ????."

??? ?????:

"?? ??????? ??????? ??? ????? ???? StreamWriter ??? ????? ???????? ????? OpenText ??? ??? ????? ???? StreamReader ????."

115 ??????: ??? ??????? CanRead ??? ????

?? ?????? 115 ? ???? ??? ??????? CanRead ?? ???? 2-30:

"????? ?? ??? ??? ???? ????? ??????? ????? ????? ??? ???. (????? ?? ??? ???.)"

??? ?????:

"????? ?? ??? ??? ???? ????? ???????. (????? ?? ??? ???.)"

120 ??????: ??????? ????? ?? CompressionMode.Decompress CompressionMode.Compress

?? ?????? 120 ????? ????? ????????? ???????? ??????? ??????:

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

??? ?????:

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

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


121 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????

?? ?????? 121 ? ???? ?????? 2:

"????? ????? ??????? (?? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

??? ?????:

"????? ??????? (?? aa ???????? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

????? 121 & 122: ????? ??????? ?????? ??? ????? ?? ?????? 7

??? ????? 121 & 122 ????? 1? ?????? 7? ????? ???????? ???????? VB ? C# ??? ?????. ??? ????????? ?? ???????, ?? ???? ??? ????? ????.

?????:
' 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();
}

???:
' 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);

122 ??????: ?????? ?????? ????? ??? ?? ??? ????? ???? 9.

??? 122 ?????? ????? ?????? 9 ????? ?????? ??? ????? ??? ????? ????????? ???????? ?????? ??? ???? ?? ?????????:

"??????: ??????? ??? ???? ?? ???? ??? ???? ?? ?????? ????? ????? ????? ??? ????? ???????. ??? ??? ?????? ??? ???? ????? ????? ????? ?? ???? ??? ??? ??? pallor ??? ??? ????? ??????."

127 ??????: ????? "???" ????????? ???? "????"

?? ?????? 127 ? ???? ??? GetDirectoryNames ?? ???? 2-36:

"?????? ??? ????? ????? ??????? ?? ???? ???? ????? ???? ?????"

??? ?????:

"?????? ??? ????? ????? ??????? ?? ???? ???? ????? ???? ????"

129 ??????: ????? IsolatedStorageFileStream ??? ????

?? ?????? 129 ? ???? ?????? ????? ?? ?????? ??????:

"??? IsolatedStorageFileStream ?????? ??? ????????? ?? ????? ????? ?? ??????? ???????."

??? ?????:

"??? IsolatedStorageFileStream ?????? ??? ??????? ????? ????? ?? ????? ????? ?? ??????? ???????."

133 ??????: ??? ??????? ????? ????? ?? ????? ?????

?? ?????? 133 ? ?????? ??? ???????? ???????? ??????? ?????? ?????:

"??????? ????? ????? ??? ????? ?? ??? ??????? ?????? ??? ???? ??? ??????? ????? ????? ???? ????? ???? ????? ???? ?????. ????? GetDirectoryNames ??? IsolatedStorageFile ???? ?? ?????? ??? ??? ????? ?????? ??? ?????? ????????: "

??? ?????:

"??????? ????? ????? ??? ????? ?? ??? ??????? ?????? ??? ???? ??? ??????? ????? ????? ???? ????? ???? ????? ????. ????? GetDirectoryNames ??? IsolatedStorageFile ???? ?? ?????? ??? ???? ????? ??? ?????? ????????: "

135 ??????: "?????" ????????? ???? "????????" ?? ?????? 2 ???????

?? ?????? 135 ? ???? ?????? 2:

"????? ????? ??????? (?? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

??? ?????:

"????? ??????? (?? aa ???????? ??????? ?? C#) ?????? ????? System.IO ?? ????? ????."

135 ??????: ??? ??????? ????? ????? ?? ??? ????

?? ?????? 135 ? ???? ?????? ?????? ?? ?????? 3 ?? ??????? 1:

"?? ????? ??????? ?? ????? ???? ????? ???? ???? ?? ?????? IsolatedStorageFile ?????? userStore ???? ?????? ???" ??????? "?" ???????? ??????."

??? ?????:

"?? ????? ??????? ?? ????? ???? ????? ???? ???? ?? ??? IsolatedStorageFile ?????? userStore ???? ?????? ???" ??????? "?" ???????? ??????."

135 ??????: ????????? ???????? ?? Visual Basic ??? ???? ?? ?????? 3

?? ?????? 135 ? ???? ????????? ???????? ?? Visual Basic ?? ?????? 3:

' VB 
IsolatedStorageFile userStore = _ 
    IsolatedStorageFile.GetUserStoreForAssembly()

??? ?????:

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


136 ??????: ????????? ???????? ?? Visual Basic ??? ???? ?? ???????? 4 ? 5

?? ?????? 136 ? ???? ????????? ???????? ?? Visual Basic ?? ?????? 4:

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


??? ?????:

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


???? ????????? ???????? ?? ?????? 5:

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


??? ?????:

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


137 ??????: ????? ????????? ???????? ??? ?????

?? ?????? 137 ? ???? ????? ?????? ?? ?????? ????? ?? ????? ???????? ????????:

// ...

??? ?????:

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


139 ???????: ????? ?? ???????? ?? ????? ?????? ?????? ??? ?????? ??? "???? ?????"

?? ?????? 139 ? ?????? ??? ???? ??? ?????? ??? "???? ?????" ????:

"???? ???? StreamReader ????????? StreamWriter instrumental ?? ??????? ?? ??? ???????? ??? ???? ?????? ??? ?? ??? FileStreams MemoryStreams IsolatedStorageFileStreams."

??? ?????:

"???? ???? StreamReader ????????? StreamWriter instrumental ?? ??????? ?? ??? ???????? textoriented ??? ???? ?????? ??? ?? ??? FileStreams MemoryStreams IsolatedStorageFileStreams."

140 ??????: ??? "?????????? ????" ??? ?????

?? ?????? 140 ? ???? ?????? ?????? ?? ?????? "?????????? ????":

"?? ???????????? ??????? ???? ?????? ???? ???? ????? ?? ????? ??? ????? ??????? ?????? ????????? ????????."

??? ?????:

"?? ???????????? ??????? ???? ?????? ???? ???? ????? ?? ????? ??? ??????? ????????."

141 ??????: ???????? ????? ?????? ????? ??? ?????? ???????

?? ?????? 141 ????? ???? "??????? ????? ?????" ????:

"???? ?????? ??? ????? ????? ????????? 1 ? 2. ???? ??? ????? ???????? ????????? ??????? ?? ??????? ??????? 3 Practice ????? ?????.

-??????? 1 ????? ????? ????? Windows ???? ?????????? ??? ???????? ???????? ?? ??????? ???????.
-??????? ?????? 2 ??????? ????? Windows ?? ???? ????? ??? ?????? ?????? ??????.
-????? ??????? ?????? 3 ??????? ?????? ??? ???????? ????? ??????? ?????? ?? ??? ???? ???????? ?? ???? ????? ??????????. "

??? ?????:

"???? ?????? ??? ????? ????? ????????? 1 ? 2. ???? ??? ????? ???????? ????????? ????? ?????? ?? ??????? ??????? ????? 3 Practice ?????.

-??????? 1 ????? ????? ????? Windows ???? ?????????? ??? ???????? ???????? ?? ??????? ???????.
-??????? ?????? 2 ??????? ????? Windows ?? ???? ????? ??? ?????? ?????? ??????.
-????? ??????? ?????? 3 ??????? ?????? ??? ???????? ????? ?????? ?????? ?? ??? ???? ???????? ?? ???? ????? ??????????. "

????? 145 & 146: ???? ????? ?????

?? ?????? 145 ??? 7 ?????? ??? VB ?????? ??? ??? 146 ?????? 11 ?????? ????????? ???????? ?? C# ????? ????? ??? ?????.

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

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

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

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

146 ??????: ???????? ????? TestRegExp ?????? ??? ?????

?? ?????? 146 ? ????? ?? ??? ??????? ???????? ??????? ????? ??? ?????? ?????? ??? ????? ??????.

?????:
C:\>TestRegExp ^\d{5}$ 1234
"???? ????? ??" ????? ??????? ??????.
C:\>TestRegExp ^\d{5}$ 12345
????? ????? ??????? ??????.

???:
C:\TestRegExp 1234 ^^\d{5}$
"??? ??????? ??" ????? ??????? ??????.
(??????: ??? ????? ??? ^ ??? ???? ??? ??????? ^ ???? ????. ?????? ^ ??? ????? ??? ????? ?????? ??? ??????? ???? ????? ?? ???? ????? ??? ??????? ????? ??????? ??? ??????? Studio Visual - Debug-.)
C:\TestRegExp 12345 ^^\d{5}$
????? ????? ??????? ??????.

165 ??????: ???????? ????? ?? ????? ReformatPhone ????? IsZip

?? ?????? 165 ? ???? ?????? ??????? ??? ????? ????????? ???????? ?? ?????? 3 ?? ??????? 2:

"?? ?? ???? ?????? ?? ???????? ???????? ?????? ????? IsZip ????? ?? ???? ??? ???:"

??? ?????:

"?? ?? ???? ?????? ?? ???????? ???????? ?????? ????? ReformatPhone ????? ?? ???? ??? ???:"

170 ??????: ??? ????? "???" ?? ???????? E

?? ?????? 170 4 ???? ???? E ???????:

"amomomottohez ???"

??? ?????:

"amomomottohez"

187 ??????: "?? ?????" ??? ?????

?? ?????? 187 ???? ????? ?? ??? Hashtable ? StringDictionary.

?????:
"Hashtable A ?????? ?? ????? ?????/?????? ?????? ???? ??????? ??? ????? ?? ????"

???:
"Hashtable A ?????? ?? ????? ?????/?????? ?????? ???? ??????? ?????"

?????:
"StringDictionary A ?????? ?? ????? ?????/??? ????? ???? ??????? ??? ????? ?? ????"

???:
"StringDictionary A ?????? ?? ????? ?????/??? ????? ???? ??????? ?????"

188 ??????: ??? ??????? ????? ????? ?? ?????? ???

?? ?????? 188 ? ???? ?????? ?????? ?? ?????? ????? "????? ???????":

"????? ??????? ???" ? "????? ????? ?? ????? ?????? ????."

??? ?????:

"????? ??????? ???" ? "????? ????? ?? ???????? ?????? ????."

192 ??????: ????? ????? ?????? ?? ????? ????????? ????????

?? ?????? 192 ? ???? ??? ?????? ?? ????? ????????? ???????? ??????:

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

??? ?????:

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


192 ??????: "++ x"??? ?? ????"x ++"

?? ?????? 192 ????? ?????? ?? ????? ????????? ???????? ?????? ??? ?????? ??? ????.

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

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

????? Microsoft Press ??? ????? ????? ??? ??????? ??????. ???? ????????? ?????????? ????????? ???????? ????? ?????? ???????? ?? printings ?????????? ?? ??? ??????. ??? ??? ???? ????? ???? ?? ??? ?????? ?? ????? ?????? ??? ???? ?? ???? ????????? ?????.

???????

???? ???????: 923018 - ????? ??? ??????: 26/????/1428 - ??????: 2.23
????? ???
  • MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 - Application Development Foundation, ISBN 0-7356-2277-9
????? ??????: 
kbmt KB923018 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????923018

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com