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 › [Help]Save Text[Solved]

[Help]Save Text[Solved]

Posts 1–8 of 8 · Page 1 of 1
Shark23
Shark23
[Help]Save Text[Solved]
Alright, so I'm trying to save some entered text to my desktop in the C drive. I have
Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        My.Computer.FileSystem.WriteAllText("C:/" & "\keys.txt", Text, True)
    End Sub
but that isn't working. It has an empty text document named keys. Any ideas?
#1 · 16y ago
NextGen1
NextGen1
Save TextBox.text as .Txt File

[php]
Imports System.IO
[/php]

Then Button click event (or whereever)

[php]
System.IO.File.WriteAllText("C:\keys.txt",TextBox1 .Text)
[/php]

or

[php]
Dim Tfile1 As String = "C:\keys.txt"
IO.File.WriteAllText(Tfile, TextBox1.Text)
[/php]

If you want to save to your desktop, use SpecialFolderpath


[php]
Dim Deskloc As String
Deskloc = Environment.SpecialFolder.Desktop


Dim Tfile As String = "Deskloc" & "keys.txt"
IO.File.WriteAllText(Tfile, TextBox1.Text)
[/php]

Hope this helps

#2 · edited 16y ago · 16y ago
zmansquared
zmansquared
i want to answer these so bad, but my vb is still craped up
#3 · 16y ago
Shark23
Shark23
It's still just having a blank text file named keys.
#4 · 16y ago
Blubb1337
Blubb1337
"C:/" & "\keys.txt" = C:/\keys.txt

how should that work o_O?

-------------------------------

Sorry nextgen, but I have to correct you


Quote Originally Posted by Nextgen1
If you want to save to your desktop, use SpecialFolderpath

Code:
 Dim Deskloc As String
        Deskloc = Environment.SpecialFolder.Desktop


        Dim Tfile As String = "Deskloc" & "keys.txt"
        IO.File.WriteAllText(Tfile, TextBox1.Text)
Deskloc will result as "0"

The actual code to get the desktop folder path is the following

Code:
Dim Deskloc As String
        Deskloc = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)


        Dim Tfile As String = "Deskloc" & "keys.txt"
        IO.File.WriteAllText(Tfile, TextBox1.Text)


------------------------------------------------------------

If that's not working for you try the following:


Code:
dim streami as streamwriter

streami = New StreamWriter("C:\test.txt")
   streami.Write(Textbox1.text)
   streami.Close()
#5 · 16y ago
NextGen1
NextGen1
I did it off top of head, I don't use special folders often cause there is no reason for me to, But in either case, thanks for the 'Correction"
#6 · 16y ago
FT
ftslynx
hmmm if your doing it from with in VB then....

uder public at the top
Code:
Dim var As New System.IO.StreamWriter("\MyText.txt", True)
make a button,
Code:
var.WriteLine()
        var.WriteLine("Name: "& textbox1.text)
var.close()
textbox1 being the box were they placed there name or something...

hope you can use this in some waty...
#7 · 16y ago
NextGen1
NextGen1
A. already answered and Solved
B. Read the rules of this section (and Mpgh) no bumping topics over 7 days

- I am not going to close this but it is marked solved, Do Not Post
#8 · 16y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Save Text to Desktop[Solved]By ppl2pass in Visual Basic Programming
    8Last post 16y ago
  • [Help]Saving settings[Solved]By Jason in Visual Basic Programming
    36Last post 16y ago
  • [Help]Saving ListView[Solved]By Lyoto Machida in Visual Basic Programming
    19Last post 15y ago
  • [Help]Rich Text[Solved]By mo3ad001 in Visual Basic Programming
    7Last post 16y ago
  • [Help]Basic Text Box[Solved]By FlashDrive in Visual Basic Programming
    3Last post 16y ago

Tags for this Thread

None