Decompile the Silverlight Project

Source: Internet
Author: User
Tags reflector

InArticleI want to explain in advance that this article does not induce readers to maliciously decompile others' works and steal others' works.CodeThe results are only used to learn Silverlight discussions.

 

On the Internet, many Silverlight projects are released every day, some of which are open source and some are just for demonstration. In the early stages of Silverlight learning, most of them require imitation learning. Therefore, when a Silverlight project is found, you can viewSource codeYes. However, when Silverlight is released, only the resource package xap is released, and all resources are in this xap file. How do I view the resources and code in the resource package? Next I will demonstrate the decompilation method. In the demo, I will use Silverlight. Net homepage Silverlight as an example.

 

1. First open Silverlight. Net, which contains a Silverlight navigation animation;

 

 

2. In the browser, right-click to view the page source code;

 

 

3. Search for "xap" in the HTML source code to quickly locate the xap location.

 

 

 

We can see that<ParamName="Source"Value="Clientbin/showcasenav. xap"/>

The value is the location of the xap on the server.

 

4. We use the same domain name to obtain the current xap file. Open a new browser and enter: http://www.silverlight.net/clientBin/showcasenav/ShowcaseNav.xap in the address bar

The browser will prompt you to download the xap file.

 

 

5. rename the downloaded file showcasenav. xap, Which is showcasenav.zip. decompress the package to the same directory. the Assembly file, class library, and configuration file used by Silverlight are displayed in the directory.

 

 

6. You can use the decompilation software that everyone is familiar with. reflector to view the resources and code files in the DLL. Click to download Reflector

 

 

7. Double-click"Mscommunities. Silverlight. showcasenav", Expand the file to see the DLL and resources. Resources contains all the XAML files and image files. The dll contains the class library background code.

 

 

 

8. Click to enter the reources directory and double-click"Mscommunities. Silverlight. showcasenav. G. Resources", You can see the resource list on the right side of reflector, select any file to view the code, right-click" Save as ", and save it to the local device, you can use vs2008 or the text editing software to view the code content.

 

 

 

 

9. corresponding to each resource file, there will be class library code, double-click"Mscommunities. Silverlight. showcasenav. dll", Then double-click"Mscommunities. Silverlight. showcasenavYou can view the various class library files. Here, we select "itemadvancecontrol" and you can see the decompilation code on the Right of reflector.

 

 

 

So far, we have already talked about how to decompile the Silverlight project, view its source code, below I want to introduce a foreign shared software, can also achieve the same effect above-Silverlight spy,: http://silverlightspy.com/silverlightspy/download-silverlight-spy/

Silverlight spy is a shared software that automatically retrieves xap files to help you Parse Files in xap. The software works with reflector to view the source code of the Silverlight project. At the same time, you can break down the style and UI in the project, and display isolated storege to developers. Enter the Silverlight. net address in the address bar. Double-click any resource and view it in the View window.

 

 

This article is transferred to yinguang China net http://silverlightchina.net/html/tips/2009/1214/407.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.