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 › Create a txt File in vb.net

UnhappyCreate a txt File in vb.net

Posts 1–7 of 7 · Page 1 of 1
42trojan42
42trojan42
Create a txt File in vb.net
Hello i just need a simple code that let you Generate a Txt file with different name random string every time you click on Button
Code:
Dim path As String = "c:\MyDir"
        Dim di As DirectoryInfo = Directory.CreateDirectory(path)
        Dim fie As System****.StreamWriter

        fie = My.Computer.FileSystem.OpenTextFileWriter("c:\MyDir\Test.txt", True)


        My.Computer.FileSystem.RenameFile("C:\MyDir\Test.txt", "SecondTest.txt")
This code is no working for me please help me
#1 · edited 11y ago · 11y ago
abuckau907
abuckau907
"Test" <> "test"
?

Not sure if you can rename a file while it's open..try I guess. Does the .RenameFile() function have a return value?
#2 · 11y ago
42trojan42
42trojan42
Quote Originally Posted by abuckau907 View Post
"Test" <> "test"
?

Not sure if you can rename a file while it's open..try I guess. Does the .RenameFile() function have a return value?
"The process cannot access the file because it is being used by another process.", No O.o
#3 · edited 11y ago · 11y ago
Jim Morrison
[MPGH]Jim Morrison
I code in C# and C++, so sorry if my VB is rusty. :P
I believe this should create a text file:
Code:
Dim TextFile As System****.StreamWriter
TextFile = My.Computer.FileSystem.OpenTextFileWriter("c:\test.txt", True)
TextFile.WriteLine("Insert text here Huehuehue")
TextFile.Close()
#4 · 11y ago
42trojan42
42trojan42
Quote Originally Posted by NormenJaydenFBI View Post
I code in C# and C++, so sorry if my VB is rusty. :P
I believe this should create a text file:
Code:
Dim TextFile As System****.StreamWriter
TextFile = My.Computer.FileSystem.OpenTextFileWriter("c:\test.txt", True)
TextFile.WriteLine("Insert text here Huehuehue")
TextFile.Close()
this code just for creating the txt file i know how to create it but i need to know how the name of the txt file change every time u create it idk a random name 31eiejf.txt , ewij4432.txt xD thx for helping
#5 · 11y ago
abuckau907
abuckau907
To create a random string...


srsly? Did you start coding yesterday? Read a f*****g book. This is beyond basic. If you don't have a specific question about how to generate a random string, what are you asking?
#6 · edited 11y ago · 11y ago
42trojan42
42trojan42
Quote Originally Posted by abuckau907 View Post
To create a random string...


srsly? Did you start coding yesterday? Read a f*****g book. This is beyond basic. If you don't have a specific question about how to generate a random string, what are you asking?
thx for helping
Sub Main()
Dim s As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
Dim r As New Random
Dim sb As New StringBuilder
For i As Integer = 1 To 8
Dim idx As Integer = r.Next(0, 35)
sb.Append(s.Substring(idx, 1))
Next
Console.WriteLine(sb.ToString())
Console.ReadKey()
End Sub
#7 · 11y ago
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help] Creating a .txt file [Solved]By urosjoj in Visual Basic Programming
    9Last post 15y ago
  • .DLL Opening As .TXT FileBy callenbs in Combat Arms Help
    11Last post 17y ago
  • <<<<((need player.txt file!!))>>>By horogon in Combat Arms Mods & Rez Modding
    5Last post 16y ago
  • Advanced .Bat / .Txt File Creator !!!By nökeinbock in Visual Basic Programming
    2Last post 16y ago
  • Advanced .Bat / .Txt File Creator !!!By nökeinbock in Visual Basic Programming
    5Last post 16y ago

Tags for this Thread

#random#txt#vb.net