Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is it possible to save data in a txt file in Recourse , en change it again later ?

[EDIT - moved from solution 3]
Ok thanks , i understand now what the problem is.
VB
TextBox1.Text = My.Resources.TextFile1


But i want this
VB
My.Resources.TextFile1 = TextBox1.Text

[/EDIT]
Posted
Updated 27-Mar-13 5:53am
v2
Comments
phil.o 27-Mar-13 9:21am    
Technically not a valid question.
What prevents you from trying ?
Jonathan [Darka] 27-Mar-13 9:23am    
It's often quicker to try something than it is to wait for an answer to a question that shouldn't have been asked in the first place.
Sergey Alexandrovich Kryukov 27-Mar-13 10:55am    
Please see my answer.
You need to explain your idea more, as well as your ultimate goal. Then you can get some practical advise.
—SA

If you mean resources embedded in the executable module, such as those created as *.resx files in your project, they are read-only by definition. During runtime, you can only read them. You can modify the resources only during development.

The reason for this is more fundamentally important than just resources: you cannot modify any of the loaded executable modules at all, not from the process using this file, not from other processes. This is the important OS safety and stability feature. By the way, this is related to the conceptions with a long history.

If you wanted something else, you need to clarify the question.

[EDIT]

Thank you for clarification. It justifies that my answer was correct. You cannot have something like My.Resources.TextFile1 = TextBox1.Text, not matter what you try, the whole idea is wrong.

However, if you try to explain why would you want it, what was your goal, you can get some useful advice.

—SA
 
Share this answer
 
v3
Comments
Maciej Los 27-Mar-13 14:42pm    
+5
Sergey Alexandrovich Kryukov 27-Mar-13 14:44pm    
Thank you, Maciej.
—SA
Maciej Los 27-Mar-13 14:45pm    
Good intuition ;)
Sergey Alexandrovich Kryukov 27-Mar-13 14:47pm    
:-)
Intuition is a daughter of information. :-)
—SA
See this: Viewing and Editing Resources in a Resource Editor[^].

Is that what you're looking for?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Mar-13 10:53am    
I don't think it was a question. It looks like OP hoped to use resources for local "private" temporary storage; no luck them.
Please see my question.
—SA
Maciej Los 27-Mar-13 11:57am    
I wasn't sure what OP asking for, that's why i wrote a question at the end of my answer. ;)
Your answer, Sergey, fully explain a problem, my was a partial solution - till OP comments (moved to question - Edit section)
Sergey Alexandrovich Kryukov 27-Mar-13 13:30pm    
Well, that clarification proves that my understanding of the question was correct; and my answers is correct.
Please see my updated answer.
—SA

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