希望你能看到我错过了什么。
在我尝试从公共类 globalv 获取此变量后发生此错误
public shared ip() as string
我删除了课程,但我仍然收到此错误..
我确实希望我的变量是“全局的”,所以我不会在每次需要时都创建一个新实例。所以我试着把它放在顶部,让它在表单中全局化。
Public Class Form1
#Region "variables"
Delegate Sub SetTextCallback(ByVal [text] As String)
Dim x As New SetTextCallback(AddressOf ReceivedText)
Dim stringOfRtb As String = rtb.Text
Dim incoming() As String
Dim ip() As String
#End Region
Private Sub btnSaveIP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveIP.Click
incoming = stringOfRtb.Split(ControlChars.CrLf.ToCharArray) ''vcrlf splitter
ip = incoming(3).Split(":"c)
txtSend.Text = "set ip local " & ip(1)
End sub
Private Sub btnSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSettings.Click
ip = incoming(3).Split("="c)
txtIP.Text = ip(1)
End sub
你们能看出什么问题吗?在此之前它一直在工作.. :(