0

i am developing a program in C# and i need to use the integrated resource file it is .txt file i need to save data to it when a button is pressed , lets say the client will press a button and then a value of "1" is saved in that txt file which is in the program resource files

BrokenGlass
  • 158,293
  • 28
  • 286
  • 335
BOSS
  • 1,828
  • 11
  • 34
  • 60
  • what do you mean by your program's resource files? Do you mean the embedded resources? – David Heffernan Jun 18 '11 at 19:14
  • 1
    This is not possible. After a resource is embedded in a DLL or EXE file by the compiler it is no longer modifiable. This is fundamental to the way executable images work in Windows. – Hans Passant Jun 18 '11 at 19:22
  • Why do you want to that? – svick Jun 18 '11 at 19:49
  • A resource is not a "text file". The "text file" you're referring to is a script used at compile time to create and embed resources (which are binary for the most part) into the compiled executable or DLL. IOW, a resource is no more a text file than your executable (written in C#) is text. – Ken White Jun 18 '11 at 20:40

1 Answers1

0

You're totally using resources wrong. That being said, you can change resources (add, delete, or modify) using UpdateResource. I don't know if it's exposed in .NET or if y You have to use PInvoke, however, as it's not exposed in .NET. Here's a post that will demonstrate it's use.

Community
  • 1
  • 1
Ken White
  • 123,280
  • 14
  • 225
  • 444