【发布时间】:2012-10-06 13:03:48
【问题描述】:
我正在处理这个项目,我在列表框中有 IP 地址,并且我已经获得了一种将列表框项目传输到文本框的方法,但我需要通过按钮更改 IP 地址。
比如我有这三个IP地址:
- 123.456.78
- 891.23.45.6
- 789.123.12
文本框中的当前 IP 地址是 123.456.78,但是当我单击一个按钮时,它也更改了第二行,即 891.23.45.6,它只能是文本框中的那个(不像 123.456.78 被推到边)。
这就是我需要的代码。
全部放在一个按钮下,比如-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'*Grabbing our proxy text from our online server (this way we can keep updating our proxies).
Dim Str As System.IO.Stream
Dim srRead As System.IO.StreamReader
Try
' make a Web request
Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("https://dl.dropbox.com/somethingOrOther")
Dim resp As System.Net.WebResponse = req.GetResponse
Str = resp.GetResponseStream
srRead = New System.IO.StreamReader(Str)
' read all the text
TextBox2.Text = srRead.ReadToEnd
Catch ex As Exception
TextBox2.Text = "Unable to download content"
Finally
' Close Stream and StreamReader when done
srRead.Close()
Str.Close()
End Try
' Assign string to reference.
Dim value1 As String = TextBox2.Text
' Replace word with another word.
Dim value2 As String = value1.Replace("<br>", vbNewLine)
TextBox2.Text = value2
ListBox1.Items.Add(TextBox2.Text)
'*Now , we're taking our fresh proxies in the textbox and moving them into our listbox.
ListBox1.Items.AddRange(TextBox2.Text.Split(vbNewLine))
End Sub
谁能帮帮我?
【问题讨论】:
-
听起来你需要一个事件处理程序来改变
-
你能发布一些你的代码吗?
-
他的意思是你能把它贴在你的问题中。
-
他的意思是“你能否以可编辑的文本格式发布它,将任何敏感信息更改为通用信息(例如将实际的 Dropbox url 更改为更温和的内容,如“dl.dropbox.xom/somedropboxurl"”)而不是screengrab,这样你就可以向我们展示你的整个按钮处理程序而不是它的一部分?”但我想我会尽我所能。:)
-
啊,我只是没有一段直接相关的代码。