.


:




:

































 

 

 

 





 

1) :

;

/ My.Computer.FileSystem.

2) , , , :

., 1405, 13.

3) :

, a b, , , a , b b. 9 ().

. My.Computer.FileSystem.

4) :

.

 

 

5) , :

5.1) :

. 4.10.7-1.

 

 

. 4.10.7-1. 10-1

 

5.2) :

, , TextBox3 TextBox5, Multiline True. , ScrollBars Vertical . TextBox4, Multiline, False, , TextBox1 TextBox2, .

, .

.

5.3) :

4.10.

5.4) :

. 4.10.7-2.


 

Public Class Form1 ' Dim Str1 As String ' Dim Rez As String ' ' . Sub (ByVal As String, ByVal str1 As String) If (My.Computer.FileSystem.FileExists()=True) Then If (MsgBox(" . ?", _ MsgBoxStyle.YesNo Or MsgBoxStyle.Question, "Overwrite")_ <> MsgBoxResult.Yes) Then Exit Sub End If ' Try My.Computer.FileSystem.WriteAllText(, str1,False) Catch ex As Exception MsgBox(" " & _ "- :" & vbCrLf & vbCrLf & ex.Message) End Try End Sub ' Sub (ByRef Str3 As String, ByVal filename As String) ' Try Str3 = My.Computer.FileSystem.ReadAllText(filename) Catch ex As Exception MsgBox(" " & _ " - :" & vbCrLf & vbCrLf & ex.Message) 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 ' Sub Resh(ByVal b As String, ByVal s1 As String, _ ByRef s2 As String) Dim a As String Dim Stroki() As String ' Stroki = Split(s1, vbNewLine) ' ' s2 = "" ' For i As Integer = 0 To Stroki.Length - 1 a = Stroki(i) ' (b, a) ' ' ' s2 s2 = s2 + a + vbNewLine Next 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(sender As Object, _ e As EventArgs) Handles Button1.Click Dim 1 As String = "" 1 = vvod(TextBox1) (Str1, 1): vivod(Str1, TextBox3) End Sub Private Sub Button2_Click(sender As Object, _ e As EventArgs) Handles Button2.Click Dim Str2 As String = "" Dim 2 As String = "" 2 = vvod(TextBox2): (Str2, 2) vivod(Str2, TextBox4) Resh(Str2, Str1, Rez): vivod(Rez, TextBox5) End Sub Private Sub Button3_Click(sender As Object, _ e As EventArgs) Handles Button3.Click Dim As String = "" = vvod(TextBox1): (, Rez) End Sub Private Sub Button4_Click(sender As Object, _ e As EventArgs) Handles Button4.Click End End Sub End Class

 

. 4.10.7-2. 10-1

 

, vvod(),
vivod(), (), Resh(), ()
(). , , , (Str1 Rez ), , () , , .





:


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


:

:

.
==> ...

1568 - | 1394 -


© 2015-2024 lektsii.org - -

: 0.01 .