trying to trying to get extract content from a web page in to a listbox

and contents are in this format

107.2.71.168:1708
107.3.217.65:1580
107.3.217.65:51723
107.43.148.15:8651
107.8.39.163:57071
107.8.63.188:11244
107.9.254.237:17209
108.222.146.33:44973

Recommended Answers

thanks for sharing!:))

Jump to Post

How you extract the data will depend on how it is stored on the web page.
The issue will be parsing the HTML.
Do you have a sample page?

Without knowing more, I would use a System.Net.WebClient and use the .OpenRead() feeding it to a StreamReader.
That way, your page …

Jump to Post

One problem is that page is not showing me the content you're talking about.
If I register there, will I see it?

Jump to Post

All 10 Replies

thanks for sharing!:))

How you extract the data will depend on how it is stored on the web page.
The issue will be parsing the HTML.
Do you have a sample page?

Without knowing more, I would use a System.Net.WebClient and use the .OpenRead() feeding it to a StreamReader.
That way, your page will be delivered to you as a stream and you can parse the lines.

any reply? guys am new learner not coder like you if u help me it would b great help for me and i will finsh my application for my personal use

One problem is that page is not showing me the content you're talking about.
If I register there, will I see it?

oh let me fix this then u can after fix i will let u know

"now fixed

see this link

Click Here

lil more information about application

i use web browser in that
no http request method plz
i want to do with web browser

OK. Here is a quick method to extract those address from that forum page:

Imports System
Imports System.IO
Imports System.Linq
Imports System.Net
Imports System.Text.RegularExpressions

Module Module1
   Function GetAddresses(ByVal strUrl As String) As List(Of String)
      Dim lst_strData As New List(Of String)
      Dim wc As New WebClient()
      Dim rxIpAndPort As New Regex("(?<IpAndPort>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,})")
      Dim fileWebIn As New StreamReader(wc.OpenRead(strUrl))
      ''
      While Not fileWebIn.EndOfStream
         lst_strData =
            fileWebIn.ReadToEnd() _
               .Split("<>".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) _
               .Where(Function(s) rxIpAndPort.IsMatch(s)) _
               .Select(Function(s) rxIpAndPort.Match(s).Groups("IpAndPort").Value) _
               .ToList()
      End While

      Return lst_strData
   End Function
   Sub Main()
      Dim lst_strIpAndPort =
         GetAddresses("http://crypo.freeforums.org/socks-t6.html")

      lst_strIpAndPort.ForEach(Sub(s) Console.WriteLine(s))
   End Sub
End Module

You can pull out that function (GetAddresses()) and use it in a Web Browser app or WinForm or console app or whatever.

not understand able for nob like me

You can copy just the function GetAddresses() and paste it in your project.
If you are filling a textbox, you can call something like this:

myTextBox.Text = String.Join(Chr(10).ToString(), GetAddresses("http://crypo.freeforums.org/socks-t6.html").ToArray())

Also, if you just try it -- stepping through with the debugger, you will see what it is doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.