Software Development Network>> Visual Basic>> Create a file
Hi, Here is a simple way to create a file.You must imports system.IO;And some thing like that in VB.net to create a write on file...Dim sw as new StreamWriter("C:\\demo.txt");sw.WriteLine("Line 1");sw.WriteLine("Line 2");sw.Close();Hope this help.
I assume theat your trying to create a simple text file or something similar to that.
Dim s as string = "Text File Contents"My.Computer.Filesystem.WriteAllText("c:\tests.txt", s, False)
My.Computer.Filesystem.Writealltext methodhttp://msdn2.microsoft.com/en-us/library/27t17sxs.aspx
Hi,
I posted VB.net code here is VB6 code.Rem writeOpen "c:\demo.txt " For Output As #1Print #1, mySerialClose #1
Rem readOpen "c:\demo.txt" For Input As #1Input #1, mySerialClose #1Hope this help.
Create a file
Jules Bonnot
vtortola
Hi,
Here is a simple way to create a file.
You must imports system.IO;
And some thing like that in VB.net to create a write on file...
Dim sw as new StreamWriter("C:\\demo.txt");
sw.WriteLine("Line 1");
sw.WriteLine("Line 2");
sw.Close();
Hope this help.
tony noriega
I assume theat your trying to create a simple text file or something similar to that.
Dim s as string = "Text File Contents"
My.Computer.Filesystem.WriteAllText("c:\tests.txt", s, False)
My.Computer.Filesystem.Writealltext method
http://msdn2.microsoft.com/en-us/library/27t17sxs.aspx
markovuksanovic
Hi,
I posted VB.net code here is VB6 code.
Rem write
Open "c:\demo.txt " For Output As #1
Print #1, mySerial
Close #1
Rem read
Open "c:\demo.txt" For Input As #1
Input #1, mySerial
Close #1
Hope this help.