How can you edit a programs own .cs file inside the code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can you edit a programs own .cs file inside the code?

I tried to read a programs own .cs file, but I was able to only read it in hexadecimal. How could I edit is as a text?

10th Dec 2019, 10:25 PM
Daveeeeee
Daveeeeee - avatar
2 Answers
0
Editing the program's .cs file will have no effect at runtime, but the code will just be changed the next time you run it. The way csharp works, there are programs called compilers reading the file and turning it to a .exe file. If you're using visual studio you probably never wouldv'e guessed, but there really isn't anything that'll change by doing that. If you could tell me what you were trying to achieve, maybe i'll find a way to solve it inside the code, instead of at runtime.
11th Dec 2019, 5:57 AM
coddy
coddy - avatar
0
I know that editing the .cs is not going to change the current running .exe. My goal is not that. I'd like to write a program, that edits a .cs file, then compiles it and executes it.
11th Dec 2019, 1:44 PM
Daveeeeee
Daveeeeee - avatar