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 › need help!? read and write (txt)

need help!? read and write (txt)

Posts 1–6 of 6 · Page 1 of 1
GE
GER-Domi.
need help!? read and write (txt)
hi i have a litte problem xD

i like to write something in a txt file.. for read i have this code:
Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Linie() As String = IO.File.ReadAllLines("C:\lol.txt")

        TextBox1.Text = Linie(0) & vbNewLine
        TextBox2.Text = Linie(1) & vbNewLine
   
    End Sub
End Class
someone know the code for write? can someone show me please!?
#1 · 16y ago
BE
Beaverman
Code:
            
Dim oWrite As New System.IO.StreamWriter(".\serial.txt")
oWrite.WriteLine("pizzaman")
oWrite.Flush()
oWrite.Close()
there ya go
#2 · 16y ago
Lolland
Lolland
Not his code though.
#3 · 16y ago
Imported
Imported
Always use "using" if you can, it's much cleaner.

[php]
Using sWrite As New IO.StreamWriter(C:\Example\Here.txt")

sWrite.WriteLine(TextBox1.Text)
sWrite.WriteLine(TextBox2.Text)

End Using
[/php]
#4 · 16y ago
GE
GER-Domi.
Ok thx i will try
#5 · 16y ago
Blubb1337
Blubb1337
Using sWrite As New IO.StreamWriter(C:\Example\Here.txt", append as boolean)


End Using

[php]Using sWrite As New IO.StreamWriter(C:\Example\Here.txt",true) 'this will APPEND the text

end using[/php]

[php]Using sWrite As New IO.StreamWriter(C:\Example\Here.txt") 'this is just going to overwrite it, why not ,false? Because it is false by default.

end using[/php]

[php]Using sWrite As New IO.StreamWriter(C:\Example\Here.txt")

for each line as string in listbox1.items
sWrite.write(line & vbnewline)
next[/php]

[php]
dim line as string
Using sRead As New IO.StreamReader(C:\Example\Here.txt")
while not sRead.EndOfStream
line = sRead.Readline
if line <> "" then
listbox1.items.add(line)
end if
end while
end using[/php]
#6 · 16y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Reading and Writing to .txt files on the internetBy treeham in Visual Basic Programming
    6Last post 16y ago
  • Need Help? READBy carbon23 in Combat Arms Hacks & Cheats
    9Last post 17y ago
  • [Tutorial/Snippet][VB6] Reading and writing INI FilesBy That0n3Guy in Visual Basic Programming
    6Last post 16y ago
  • Need help reading KoreanBy zxcdserf in Suggestions, Requests & General Help
    2Last post 16y ago
  • [TUT]How to read and write to a text fileBy XORxHACK in Java
    18Last post 16y ago

Tags for this Thread

None