Writing to a text file

Gluttard

Active member
Joined
Jan 9, 2008
Messages
44
Programming Experience
Beginner
I'm making a simple little program that has two radio buttons (ReadFrom and WriteTo), a multi-lined textbox, and a button. It also has a textfile as a resource, named Information.txt.
When readfrom is checked and the button is pressed, the text from the textfile is displayed in the textbox, this works as it's supposed to.

PHP:
        If WriteTo.Checked = True Then
            My.Resources.Information = TextBox1.Text
        End If

This gives me the error, [Property 'Information' is 'ReadOnly']
Yet I cannot make information.txt non-readonly. How can I write to it?
Oh, and I want it to replace the previous text in the file.
 
Last edited:
You can't, the resources are built into the application assembly when you compile it and this can't be changed in runtime. Create an application user setting if you need write access in application storage system.
 
Err sorry, but I'm a bit new and I didn't understand most of that. How would one create this 'application user setting'?
 
Project properties, Settings tab. (help topics: "application settings")
 
Thanks JohnH, I feel bad asking all these questions but I think I just need to get better at searching for help. You've been extremely helpful though, you should get some kind of award.
 
Back
Top