How Winform project decompile form displays

Winform decompile, if you want to make it as normal as engineering, can form editor, edit, need to do some work.

 

1. Conversion to .resx .resources

Resgen use tool. This tool is built-vs.

In the start menu, find:

Command Prompt

Then enter the directory .resources, such as call xx.resources

resgen xx.resources xx.resx

 

2. After the conversion, and the form code, xx.resx into a directory.

Here, VS will be very clever, showing xx.cs below, there is a resx file, then right, the .resx added to the project.

 

3. Double-click to open, you will see some errors:

This is because System.ComponentModel this library.

Form designer, not a separate program, it takes the form of parsing code is performed. I do not know why Microsoft

Of course, the solution is simple:

Note the phrase out using System.ComponentModel;, then put all the wrong places, preceded by System.ComponentModel

 

OK yet? Not yet, there are more cattle B errors,

Microsoft's form designer mistakenly identified only one variable, called resources

Let's say, with Redflector decompile, the operator's name: manager

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ConfirmMsg));

Must be changed

       System.ComponentModel.ComponentResourceManager resources= new System.ComponentModel.ComponentResourceManager....

 

In some cases, this is not to the general System.Windows.Forms library is out of the question.

Then you do the same, the System.Windows.Forms also note off. Then all the places used, together with all this space.

Guess you like

Origin www.cnblogs.com/ioter/p/11428897.html