Answer the question
In order to leave comments, you need to log in
How to open dll file as text in c#?
You need to open the dll file as text, edit it and save it back. After opening by standard means, it reads only the first two letters MZ, and then puts a question mark in a triangle, although there is a lot of everything after mz. How to do it, for example, using the same notepad++, but through c#? Or is there a more convenient way/library?
Answer the question
In order to leave comments, you need to log in
dll is an executable file, that is, it contains binary code. This code was generated by the .net platform compiler.
If no protection measures have been applied to the code, then you can restore the C# code using utilities that can work with IL code. For example ".NET Reflector"
In order to read the contents of a dll file, it must be opened as a binary file, not as a text file. The resulting byte array can already be interpreted as text in the desired encoding.
The easiest and most convenient way, if there are a lot of changes or they are not simple.
Download free dotpeek .
Open dll or exe in it as a project (project files will be generated).
We edit and compile again, but with the changes made.
If you want without recompiling, then there are many other utilities, I forgot the names already, but there are many of them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question