Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, please i am using vb to code in visual studio2012. I want to know of a way to write some string into a file and not a text file but i want to specify the extension of the file i am saving the strings to. Please, help me out. I am using vb
Posted

You may specifier whatever extension you like, in the file creation call. No one would stop you writing textual data inside a, for instance, .bin file.
 
Share this answer
 
Try:
VB
File.WriteAllText("D:\Temp\MyFile.XZY", "This is some text...")
 
Share this answer
 
Comments
[no name] 1-Apr-15 11:42am    
I am think of using the 'appendtext' for string builder. How can you use it in your code above
OriginalGriff 1-Apr-15 12:01pm    
You mean:
File.WriteAllText("D:\Temp\MyFile.XZY", myStringBuilder.ToString())
[no name] 1-Apr-15 13:30pm    
Yep. Something like this. I will let you know when i try it out.
One more thing, i wan to download mulitple files in a folder but if i use 'downloadfile', it just overwrites the file previously downloaded and i dnt knw how to use the 'downloadfileasync'
OriginalGriff 1-Apr-15 14:03pm    
You'll have to remember that I can;t seen your screen, access your HDD or read your mind! :laugh:

Give me more details to work with!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900