一个不错的Silverlight展示网站反编译后的源码和大家分享一下(http://www.microsoft.com/taiwan/student/Good.htm),很简单的
只是微软的一个Silverlight展示网站。
涉及到的反编译知识:
一。关于Linq的IL
1. 源代码:
XmlReader reader = XmlReader.Create(new StringReader(e.Result));
XDocument document = XDocument.Load(reader);
var projects = from f in document.Descendants("mspData")
where (f.Attribute("expire").Value == this.expire_id.ToString())
select new mspDatas
{
expire = int.Parse(f.Attribute("expire").Value),
Name = f.Attribute("Name").Value,
nickName = f.Attribute("nickName").Value,
school = f.Attribute("school").Value,
email = f.Attribute("email").Value,
msn = f.Attribute("msn").Value,
blogTitle = f.Attribute("blogTitle").Value,
blogUrl = f.Attribute("blogUrl").Value,
imgFile = f.Attribute("imgFile").Value,
Introduce = f.Value
};
List<mspDatas> list = new List<mspDatas>();
list.AddRange(projects);
2.反编译后的代码:
if (CS$<>9__CachedAnonymousMethodDelegate5 == null)
{
CS$<>9__CachedAnonymousMethodDelegate5 = new Func<XElement, mspDatas>(null, (IntPtr) <client_DownloadStringCompleted>b__4);
}
IEnumerable<mspDatas> collection = Enumerable.Select<XElement, mspDatas>(Enumerable.Where<XElement>(XDocument.Load(XmlReader.Create(new StringReader(e.get_Result()))).Descendants("mspData"), new Func<XElement, bool>(this, (IntPtr) this.<client_DownloadStringCompleted>b__3)), CS$<>9__CachedAnonymousMethodDelegate5);
List<mspDatas> list = new List<mspDatas>();
list.AddRange(collection);
http://dev.firnow.com/course/4_webprogram/asp.net/asp_netxl/20100629/232110.html 此地址对Linq进行了讲解,有趣的朋友到此网站了解一些Linq的IL知识
二、[CompilerGenerated]自动生成属性属性
1.源代码
public int Pages { get; set; }
public bool IsPro { get; set; }
1.反编译后的代码:
[CompilerGenerated]
private bool <IsPro>k__BackingField;
[CompilerGenerated]
private int <Pages>k__BackingField;
public bool IsPro
{
[CompilerGenerated]
get
{
return this.<IsPro>k__BackingField;
}
[CompilerGenerated]
set
{
this.<IsPro>k__BackingField = value;
}
}
public int Pages
{
[CompilerGenerated]
get
{
return this.<Pages>k__BackingField;
}
[CompilerGenerated]
set
{
this.<Pages>k__BackingField = value;
}
}
三、 [DebuggerNonUserCode]属性来限制代码正在调试/步入