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 to Desktop[Solved]

Question[Help]Save Text to Desktop[Solved]

Posts 1–9 of 9 · Page 1 of 1
PP
ppl2pass
[Help]Save Text to Desktop[Solved]
How do you make an option in vb.net to save text to desktop?
#1 · 16y ago
Blubb1337
Blubb1337
did you google yet?...

google for streamwriter.
#2 · 16y ago
Bombsaway707
Bombsaway707
Let me google that for you
Click It Click It Click It, its majix
#3 · 16y ago
zmansquared
zmansquared
Here you go. Thank me please

Change the user name to yours

[php]Imports System.IO
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim TextFile As New StreamWriter("c:\Users\Zack\Desktop\test.txt")
TextFile.WriteLine("Text here")
' make more of these TextFile.WriteLine("Text here")to get more lines.
TextFile.Close()



End Sub
End Class[/php]
#4 · 16y ago
NextGen1
NextGen1
Professionally and commercially you would want to do this without hard-coding the direct path , because if a 3rd party uses it, they will not be able to save the txt file to the desktop path.

Use

[php]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim DesktopPath As String = Environment.GetFolderPath(Environment.SpecialFolde r.DesktopDirectory)

Dim TextFile As New StreamWriter(DesktopPath & test.txt")
TextFile.WriteLine("Text here") ' or textbox.text
' make more of these TextFile.WriteLine("Text here")to get more lines.
TextFile.Close()


End Sub
[/php]

A good note to all developers is to remember that vb.net allows you to access user folders as special folders without hardcoding the user name and path

[php]
Environment.SpecialFolder.
[/php]

This will give you access to

Cookies
Desktop
My Pictures
My Documents
History
etc
etc

Without the need for the username

added to code snippets vault post 1


this will allow saving to anyones desktop


#5 · edited 16y ago · 16y ago
zmansquared
zmansquared
You copied some of my code nextgen . LOL
#6 · 16y ago
NextGen1
NextGen1
Its MSDN Standard, But yes I part of your above example to make sense of the prior :d
#7 · edited 16y ago · 16y ago
zmansquared
zmansquared
Woot Nextgen1 used one of my examples WOOT. HAH thanks
#8 · 16y ago
MJLover
MJLover
OR

[php] My.Computer.FileSystem.WriteAllText(My.Computer.Fi leSystem.SpecialDirectories.Desktop & "\filename.txt", "Text here...", False)
[/php]
#9 · 16y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Save Text[Solved]By Shark23 in Visual Basic Programming
    7Last post 16y ago
  • [Help] Save Items in Combobox[Solved]By FatCat00 in Visual Basic Programming
    8Last post 16y ago
  • [Help]Save track bar settings[Solved]By jajarem64 in Visual Basic Programming
    16Last post 16y ago
  • [Help] Saving resources to disk?[Solved]By master131 in Visual Basic Programming
    3Last post 15y ago
  • [Help]Save Contents of TextBox[Solved][Closed]By bayley60 in Visual Basic Programming
    2Last post 16y ago

Tags for this Thread

None