How do you extract classes' source code from a

2020-02-08 11:07发布

Is there any software to do this? I didn't find any useful information on the internet so I am asking here.

10条回答
我欲成王,谁敢阻挡
2楼-- · 2020-02-08 11:54

Use Refractor. Download from here.

  1. Open the software after installing.
  2. Press Ctrl + O and select your DLL File.
  3. Dll will be shown in left pane.
  4. Right click on Dll and select Export Source Code.
  5. Select the folder in which you want to export your files
  6. Wait for a while it may take 2-3 minutes

enter image description here

查看更多
smile是对你的礼貌
3楼-- · 2020-02-08 11:54

I used Refractor to recover my script/code from dll file.

查看更多
乱世女痞
4楼-- · 2020-02-08 11:54
 var destinationfilename = "";
        if (System.IO.File.Exists("nameoffile.dll"))
        {
          destinationfilename = (@helperRoot + System.IO.Path.GetFileName(medRuleBook.Schemapath)).ToLower();
          if (System.IO.File.Exists(destinationfilename)) System.IO.File.Delete(destinationfilename);
          System.IO.File.Copy(@'nameoffile.dll", @destinationfilename);
        }
        // use dll-> XSD
        var returnVal =
          await DoProcess(
            @helperRoot + "xsd.exe", "\"" + @destinationfilename + "\"");
        destinationfilename = destinationfilename.Replace(".dll", ".xsd");
        if (System.IO.File.Exists(@destinationfilename))
        {
          // now use XSD
          returnVal =
            await DoProcess(
              @helperRoot + "xsd.exe", "/c /namespace:RuleBook /language:CS " + "\"" + @destinationfilename + "\"");
          if (System.IO.File.Exists(@destinationfilename.Replace(".xsd", ".cs")))
          {
            var getXSD = System.IO.File.ReadAllText(@destinationfilename.Replace(".xsd", ".cs"));

          }
        }
查看更多
乱世女痞
5楼-- · 2020-02-08 12:00

Use dotPeek

enter image description here

Select the .dll to decompile

enter image description here

That's it

查看更多
登录 后发表回答