Chrome : // policy (RichTextbox에서 입력)의 원시 목록을 텍스트 배열로 구문 분석 한 다음 다른 RichTextbox에 덤프하는 프로그램을 만들려고했습니다. 모든 원시 문자열의 길이는 정확히 32 자이며 뒤에 쉼표가 있습니다. 다음은 코드입니다.
Public Class Form1
Dim tempExt As String
Dim extsHandled As Integer
Dim numOfExts As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If RichTextBox1.Text = "" Then
MsgBox("Please enter the raw extensions from Chrome://policy")
Else
RichTextBox3.Text = RichTextBox1.Text
numOfExts = TextBox1.Text
Dim place As Integer = 0
Dim exts(150) As String
While extsHandled < numOfExts
tempExt = RichTextBox1.Text.Substring(0, 32)
exts(place) = tempExt
RichTextBox1.Text.Remove(0, 33)
place = place + 1
extsHandled = extsHandled + 1
End While
Dim newPlace As Integer = 0
While newPlace < numOfExts
RichTextBox2.AppendText(exts(newPlace))
newPlace = newPlace + 1
RichTextBox2.AppendText(" ")
End While
End If
End Sub
End Class
대부분은 작동하지만 리치 텍스트 상자에서 문자를 제거하면 문제가 발생하는 것처럼 보입니다. 실행하면 문자열의 첫 부분 만 계속해서 구문 분석합니다.
내가 뭘 잘못하고 있니?
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다