Lightbulb[Help] Creating a .txt file [Solved]

Posts 1–10 of 10 · Page 1 of 1
[Help] Creating a .txt file [Solved]
Hi!

I didn't find the code anywhere else, so I'll explain what I'm looking for here. It's actually very simple. I want the program, that I made in Visual Basic to make a .txt in a specific directory, with a specific file name.

Regards.
[highlight=VB.NET]Using sWrite as new io.streamwriter("path")
swrite.write("body")
end using[/highlight]
lol
Code:
dim x as new savefiledialog with {.title = "save ur text...", .filter = "text file *.txt | *.txt}
IO.File.Create(x.filename)
msgbox("File created! - Thanks 3Li0")
You can use a streamwriter or reader to write a value on it or read the current value....

Quote Originally Posted by Blubb1337 View Post
[highlight=VB.NET]Using sWrite as new io.streamwriter("path")
swrite.write("body")
end using[/highlight]
oh come on let me solve a thread in my life
Or...another method:

[highlight=vb.net]
IO.File.WriteAllText("C:\Test.txt", "Jason is sick of spammarz")
[/highlight]

There's a tonne of options you can choose from.
Thank you all, guys! Didn't expect so much help .
An other method

[highlight=vb.net]
My.Computer.FileSystem.WriteAllText("C:\Test.txt", "Topblast is sick of stupid kids who waste they lives.")
[/highlight]
Or we could get really silly about it:

[highlight=vb.net]
Using bWrite As New IO.BinaryWriter(New IO.FileStream("C:\test.txt", IO.FileMode.OpenOrCreate))
bWrite.Write(System.Text.Encoding.ASCII.GetBytes(" Jason is a sick motherfucker"))
End Using
[/highlight]

But I'm going to go right ahead and marked this solved.
Quote Originally Posted by Jason View Post
Or we could get really silly about it:
Yea we can

[Highlight=c++]

ofstream file("whit.txt");;
file << "C++ guy owns you all.\n";
file.close();

[/Highlight]
Quote Originally Posted by whit View Post

Yea we can

[Highlight=c++]

ofstream file("whit.txt");;
file << "C++ guy owns you all.\n";
file.close();

[/Highlight]
GET OUT OF HERE!
Quote Originally Posted by Jason View Post
Or we could get really silly about it:

[highlight=vb.net]
Using bWrite As New IO.BinaryWriter(New IO.FileStream("C:\test.txt", IO.FileMode.OpenOrCreate))
bWrite.Write(System.Text.Encoding.ASCII.GetBytes(" Jason is a sick motherfucker"))
End Using
[/highlight]

But I'm going to go right ahead and marked this solved.
Quote Originally Posted by whit View Post

Yea we can /yaahman

[Highlight=c++]

ofstream file("whit.txt");;
file << "C++ guy owns you all.\n";
file.close();

[/Highlight]
Indeed, very silly :)

Code:
HAI
CAN HAS STDIO?
I HAS A name ITZ "AWSUMM"
O HAI IM "SHWEET"
PLZ OPEN FILE "LOLCATS.TXT"?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE "ERROR!"
KTHX
KTHXBYE
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

Talk with us