.


:




:

































 

 

 

 


.




. 4.10.7-3.

. 4.10.7-3. 10-1

.

a = "aabbssvvffgghh". b= "absh" a s. , = "bbvvffgghh". , . , , .. "bbvvffgghh", , .

 

 

 

1) :

.

/

StreamReader, StreamWriter.

2) , , , :

., 1405, 13.

3) :

, b, , , , b, 9 (). () . StreamReader, StreamWriter.

4) :

.

5) , :

. 4.10.7-4.

, ListBox. , , , TextBox4, Multiline True ScrollBars Vertical . TextBox3 Multiline, False, , TextBox1 TextBox5 TextBox6 .

 

. 4.10.7-4. 10-2

 


5.2) :

.

5.3) :

4.10.

5.4) :

. 4.10.7-5.

Resh() StreamReader 1 , () 3 StreamWriter. readfile() StreamReader . , , b, 2 , , ( ), , .

 

Option Strict On Option Explicit On Imports System.IO Public C lass Form1 Dim b As String ' b ' 1 3 Sub Resh(ByVal filename1 As String, _ ByVal filename3 As String, _ ByVal b As String, ByRef L As ListBox) ' 1 Dim Rf As New StreamReader(filename1) ' ' True 2- , ' Dim wf As New StreamWriter(filename3, True) Dim a As String Try Do While Not Rf.EndOfStream() ' a = Rf.ReadLine() ' 1 L.Items.Add(a) ' ListBox (b, a) ' a wf.WriteLine(a) ' . Loop Catch ex As Exception MsgBox(" ") Finally wf.Flush():Rf.Close(): wf.Close() End Try End Sub ' Sub readfile(ByVal filename As String, _ ByRef b As String) ' Dim Rf As StreamReader Rf = New StreamReader(filename) Try b = Rf.ReadToEnd() ' b Rf.Close() ' Catch ex As Exception MsgBox(" ") End Try End Sub ' (. ) Sub (ByVal b As String, ByRef a As String) Dim d, m, i, j As Short m = CShort(a.Length) ' a d = CShort(b.Length ) ' b For i = 0 To CShort(d-1) Step 2 ' .. b j = 0 Do While j < m ' a If a.Substring(j, 1) = b.Substring(i, 1) Then a = a.Remove(j, 1)' ..- a m = CShort(m - 1) ' a Else j = CShort(j + 1) ' . a End If Loop Next i End Sub Function vvod(ByVal T As TextBox) As String Return T.Text End Function Sub vivod(ByVal z As String, ByRef t As TextBox) If z.Length <> 0 Then t.Text = z Else t.Text = " " End If End Sub ' Private Sub Button1_Click(ByVal sender As System.Object,_ ByVal e As System.EventArgs) Handles Button1.Click Dim 2 As String = "" 2 = vvod(TextBox5) readfile(2, b) vivod(b, TextBox3) End Sub ' 1 ' Private Sub Button3_Click(ByVal sender As System.Object,_ ByVal e As System.EventArgs) Handles Button3.Click Dim 3 As String = "" Dim 1 As String = "" 1 = vvod(TextBox1) 3 = vvod(TextBox6) Resh(1, 3, b, ListBox1) End Sub ' () ' Private Sub Button2_Click(ByVal sender As System.Object,_ ByVal e As System.EventArgs) Handles Button2.Click Dim 3 As String = "" 3 = vvod(TextBox6) Dim Rez As String = "" readfile(3, Rez) vivod(Rez, TextBox4) End Sub Private Sub Button6_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button6.Click End End Sub End Class

 

. .1.10-5. 10-2

6) :

. 4.10.7-6.

 

 

. 4.10.7-6. 10-2

7) :

, 1 3 b (.. a d), .

 

 

1) ?

2) ?

3) ?

4) ?

5) , , ?

6) ?

 





:


: 2016-11-24; !; : 349 |


:

:

, ,
==> ...

1235 - | 1193 -


© 2015-2024 lektsii.org - -

: 0.016 .