Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [TUT] Reading lines from a web document.

[TUT] Reading lines from a web document.

Posts 1–11 of 11 · Page 1 of 1
Jason
Jason
[TUT] Reading lines from a web document.
Well this isn't so much a tut as a quick snippet. It's a pretty handy function. I'll do my best to explain what it does within the code by annotating.

I'm not sure if this is the most effective way of doing it but yeah, I just figured this out myself 'cos nothing was really working. Pretty simple to follow but very useful. I used this extensively in my MPGH.net download and multi-tool (both got closed 'cos they were too epic)

anywho,

here's the function

[php]
Function ReadLiner(ByVal Pageurl As String)

Dim Lines As String = ""
Try
Dim request As HttpWebRequest = WebRequest.Create(Pageurl)
Dim response As HttpWebResponse = request.GetResponse()
Using reader As StreamReader = New StreamReader(response.GetResponseStream())

Lines = reader.ReadLine 'reads the current line'

Do While (Not Lines Is Nothing) 'will do the following for every line until it encounters an empty line, do whatever you want here'

'do something here, ill put an example underneath'

Console.WriteLine(Lines)

Lines = reader.ReadLine

Loop

End Using

Catch ex As Exception

'if the URL isnt found, what will you do?'

End Try

Return Lines

End Function
[/php]

Then to use:

[php]

ReadLiner("http://example.com/test.txt") ' your URL goes there'

[/php]


examples of use:

1. Add each line to a listbox.

[php]
Function ReadLiner(ByVal Pageurl As String)

Dim Lines As String = ""
Try
Dim request As HttpWebRequest = WebRequest.Create(Pageurl)
Dim response As HttpWebResponse = request.GetResponse()
Using reader As StreamReader = New StreamReader(response.GetResponseStream())

Lines = reader.ReadLine 'reads the current line'

Do While (Not Lines Is Nothing)

Listbox1.Items.Add(Lines)

Console.WriteLine(Lines)

Lines = reader.ReadLine

Loop

End Using

Catch ex As Exception



End Try

Return Lines

End Function
[/php]


2. Incorporating cases (only realistic with a few cases, I used something similar in my downloader with 4 cases -.-)

[php]
Function ReadLiner(ByVal Pageurl As String)

Dim i as Integer = 0

Dim Lines As String = ""
Try
Dim request As HttpWebRequest = WebRequest.Create(Pageurl)
Dim response As HttpWebResponse = request.GetResponse()
Using reader As StreamReader = New StreamReader(response.GetResponseStream())

Lines = reader.ReadLine 'reads the current line'

Do While (Not Lines Is Nothing)
i += 1 '(this adds 1 to the integer 'i' every new line)'
Select Case(i)
Case1
'Do what you want for the first line for example'
Label1.Text = Line

Case2
'what do you want to do with the 2nd line..'

'etc etc etc, add more cases as the need arises'

End Select

Console.WriteLine(Lines)

Lines = reader.ReadLine

Loop

End Using

Catch ex As Exception

'if the URL isnt found, what will you do?'

End Try

Return Lines

End Function
[/php]

And yeah that's about it for reading each line of a document. Hope someone gets something out of this.

J-Deezy
#1 · 16y ago
Julma Henri
Julma Henri
Nice tut J-Deezy
#2 · 16y ago
Hassan
Hassan
Nice tutorial !! Thanks for sharing..
#3 · 16y ago
/B
/b/oss
j-dezzy awesomnness aggaiN!
#4 · 16y ago
Jason
Jason
Quote Originally Posted by m_t_h View Post
j-dezzy awesomnness aggaiN!
J-Deezy ** but thanks.
#5 · 16y ago
'Bruno
'Bruno
Quote Originally Posted by J-Deezy View Post
J-Deezy ** but thanks.
NOT A SPAMMER!!! YAY!! finally, nice one J-Deezy.
#6 · 16y ago
Jason
Jason
Quote Originally Posted by Brinuz View Post
NOT A SPAMMER!!! YAY!! finally, nice one J-Deezy.
Hahaha maybe I should incorporate it into a spammer. I'm watching NCIS right now so im aircoding right here

No C&P, I don't have VB on this computer, wonder how many syntax errors i get

You ned (for this fictional piece of shit)

TextBox1 is the delay
Button1 is to fill the listbox from the website specified in TextBox2
TextBox2 is the webpage to read from
Button2 is to start spam
Button3 is to stop spam
lblStatus states the status (spamming/idle)

FUCK YEAH!

[php]
Imports System.NET
Imports System.IO

Public Class Form1

Private Function Reade(ByVal pages As String)

dim lines as string = ""

Try
Dim request As HttpWebRequest = WebRequest.Create(Pages)
Dim response As HttpWebResponse = request.GetResponse()
Using reader As StreamReader = New StreamReader(response.GetResponseStream())

lines = reader.readline

Do while (not lines is nothing)

ListBox1.Items.Add(lines)
Console.WriteLine(lines)
lines = reader.readline

Loop


End Using
Catch ex As Exception

End Try

Return lines
End Function

Private Sub Button1_click(ByVal...yeah shit goes here im not that good) Handles Button1.click

'summary: This button fills the listbox with the text'
If not TextBox2.Text = "" then
try
reade(TextBox2.Text)
catch ex as Exception
End try

Else: MsgBox("Please enter a website to load from", vbinformation, "No website specified")


End Sub

Private Sub randomline()
'this generates a random listbox entry'
dim randoms as new random
dim x as integer = ListBox1.Items.Count
dim i as integer = randoms.next(0, x)

ListBox1.SelectedIndex = i

End Sub

Private sub Timer1_tick(ByVal....) Handles Timer1.Tick
'spams a random listbox entry'
call randomline()
SendKeys.Send(Listbox1.SelectedItem)
SendKeys.Send("{ENTER}")

End Sub

Private Sub Button2_click(ByVal....) Handles Button2.Click
'the start spam button'
if not textbox1.text = "" then
Timer1.Interval = Textbox1.Text 'oh yeah customizable delay ^^'
Else: Timer1.Interval = 200
End If

Timer1.Start()
lblStatus = "Spamming"
lblStatus.ForeColor = Color.Lime

End Sub

Private Sub Button3_click(Byval....)Handles Button3.Click
'the stop spam button'

Timer1.Stop()
lblStatus = "Idle"
lblStatus.ForeColor = Color.Red

End Sub

End Class

[/php]

Air code over and out
#7 · 16y ago
HA
Hawky1337
Not hard, but very good job. A lot of people don't know how to do such.

Tip: Instead of rewriting a long code everytime and changing just a bit, simply do one function (see above)
#8 · 16y ago
Jason
Jason
Wow I'm a genius, my above code worked flawlessly.
#9 · 16y ago
Hassan
Hassan
Quote Originally Posted by J-Deezy View Post
Wow I'm a genius, my above code worked flawlessly.
Haha then you won't mind checking these xD :

[Collection]Snippets Vault - Visual Basics - MPGH - MultiPlayer Game Hacking

[Collection]Snippets Vault - Visual Basics - MPGH - MultiPlayer Game Hacking

#10 · 16y ago
Jason
Jason
Quote Originally Posted by FLAMESABER View Post
Haha then you won't mind checking these xD :

[Collection]Snippets Vault - Visual Basics - MPGH - MultiPlayer Game Hacking

[Collection]Snippets Vault - Visual Basics - MPGH - MultiPlayer Game Hacking

Shut up , I be but a humble choob next to the awesome might of your VB knowledge. Minion this douche now plocks.
#11 · 16y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • Reading lines from text file?By ppl2pass in Visual Basic Programming
    4Last post 16y ago
  • Getting "Class" attribute from a web browser documentBy willrulz188 in Visual Basic Programming
    3Last post 14y ago
  • [TUT]How to read input from keyboardBy XORxHACK in Java
    3Last post 16y ago
  • Fixes for various Errors, Read!(straight from Nexon Forums)By mariokiller64 in Combat Arms Hacks & Cheats
    9Last post 18y ago
  • where's a tut on how to hack web based games like runescape?By thechewu in General
    11Last post 19y ago

Tags for this Thread

None