﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-过江的博客</title><link>http://www.cnblogs.com/gjahead/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 24 Jul 2008 07:56:14 GMT</lastBuildDate><pubDate>Thu, 24 Jul 2008 07:56:14 GMT</pubDate><ttl>60</ttl><item><title>请问在用C#+Mapx开始，怎样根据图元名称获得该图元已经选中的图元</title><link>http://www.cnblogs.com/gjahead/archive/2008/05/09/1190076.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Fri, 09 May 2008 07:29:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2008/05/09/1190076.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/1190076.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2008/05/09/1190076.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/1190076.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/1190076.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;近来在学习Mapx，遇到一些问题：<BR>&nbsp;&nbsp;&nbsp;1：根据图元的名称，比如：中国地图里的“BEIJING”，获得这个图元对象。<BR>&nbsp;&nbsp;&nbsp;2：获得地图中选中的图元。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请各位高手指导下，在此先谢谢大家！<img src ="http://www.cnblogs.com/gjahead/aggbug/1190076.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41275/" target="_blank">[新闻]Mozilla将于本周五发布Firefox 3.1第一个预览版</a>]]></description></item><item><title>C#基础：ref和out的区别</title><link>http://www.cnblogs.com/gjahead/archive/2008/02/28/1084871.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Thu, 28 Feb 2008 05:46:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2008/02/28/1084871.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/1084871.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2008/02/28/1084871.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/1084871.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/1084871.html</trackback:ping><description><![CDATA[<P>ref和out的区别在C# 中，既可以通过值也可以通过引用传递参数。通过引用传递参数允许函数成员更改参数的值，并保持该更改。若要通过引用传递参数， 可使用ref或out关键字。ref和out这两个关键字都能够提供相似的功效，其作用也很像C中的指针变量。它们的区别是：</P>
<P>1、使用ref型参数时，传入的参数必须先被初始化。对out而言，必须在方法中对其完成初始化。 </P>
<P>2、使用ref和out时，在方法的参数和执行方法时，都要加Ref或Out关键字。以满足匹配。 </P>
<P>3、out适合用在需要retrun多个返回值的地方，而ref则用在需要被调用的方法修改调用者的引用的时候。 </P>
<P>注：在C#中，方法的参数传递有四种类型：传值（by value），传址（by reference），输出参数（by output），数组参数（by array）。传值参数无需额外的修饰符，传址参数需要修饰符ref，输出参数需要修饰符out，数组参数需要修饰符params。传值参数在方法调用过程中如果改变了参数的值，那么传入方法的参数在方法调用完成以后并不因此而改变，而是保留原来传入时的值。传址参数恰恰相反，如果方法调用过程改变了参数的值，那么传入方法的参数在调用完成以后也随之改变。实际上从名称上我们可以清楚地看出两者的含义--传值参数传递的是调用参数的一份拷贝，而传址参数传递的是调用参数的内存地址，该参数在方法内外指向的是同一个存储位置。</P>
<P>方法参数上的 ref 方法参数关键字使方法引用传递到方法的同一个变量。当控制传递回调用方法时，在方法中对参数所做的任何更改都将反映在该变量中。</P>
<P>若要使用 ref 参数，必须将参数作为 ref 参数显式传递到方法。ref 参数的值被传递到 ref 参数。</P>
<P>传递到 ref 参数的参数必须最先初始化。将此方法与 out 参数相比，后者的参数在传递到 out 参数之前不必显式初始化。</P>
<P>属性不是变量，不能作为 ref 参数传递。</P>
<P>如果两种方法的声明仅在它们对 ref 的使用方面不同，则将出现重载。但是，无法定义仅在 ref 和 out 方面不同的重载。</P>
<P>out</P>
<P>方法参数上的 out 方法参数关键字使方法引用传递到方法的同一个变量。当控制传递回调用方法时，在方法中对参数所做的任何更改都将反映在该变量中。</P>
<P>当希望方法返回多个值时，声明 out 方法非常有用。使用 out 参数的方法仍然可以返回一个值。一个方法可以有一个以上的 out 参数。</P>
<P>若要使用 out 参数，必须将参数作为 out 参数显式传递到方法。out 参数的值不会传递到 out 参数。</P>
<P>不必初始化作为 out 参数传递的变量。然而，必须在方法返回之前为 out 参数赋值。</P>
<P>属性不是变量，不能作为 out 参数传递。<BR><BR><BR>网上有很多文章说ref 只传值，out传地址等等这种说法，好像不是非常的准确。以下是我做的实例代码，大家可以去试试：<BR><BR>&nbsp;public int&nbsp; RefValue(int i,ref int j)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int k = j;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j =222;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i+k;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public int OutValue(int i, out int j)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j = 222;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i + j;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void cmdRef_Click(object sender, EventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int m = 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show(RefValue(1, ref m).ToString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show(m.ToString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void cmdOut_Click(object sender, EventArgs e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int m;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show(OutValue(1, out m).ToString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show(m.ToString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>借网上总结的一句话说，ref是有进有出，而out是只出不进。</P><img src ="http://www.cnblogs.com/gjahead/aggbug/1084871.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41274/" target="_blank">[新闻]瑞星将向个人用户免费1年</a>]]></description></item><item><title>仿163邮箱的alert提示，beta1.1 (转）</title><link>http://www.cnblogs.com/gjahead/archive/2007/10/14/924001.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Sun, 14 Oct 2007 13:06:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/10/14/924001.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/924001.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/10/14/924001.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/924001.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/924001.html</trackback:ping><description><![CDATA[<DIV class=posthead>
<H2><A class=singleposttitle id=AjaxHolder_ctl01_TitleUrl href="/jianphu/archive/2007/10/14/923801.html"><FONT color=#223355>仿163邮箱的alert提示，beta1.1</FONT></A> </H2>Posted on 2007-10-14 15:44 <A href="http://jianphu.cnblogs.com/"><FONT color=#223355>刺猬博客</FONT></A> 阅读(42) <A href="/jianphu/archive/2007/10/14/923801.html#Post"><FONT color=#223355>评论(0)</FONT></A> &nbsp;<A href="/jianphu/admin/EditPosts.aspx?postid=923801"><FONT color=#223355>编辑</FONT></A> &nbsp;<A id=lnkFavorite923801 onclick="Favorite(923801,'仿163邮箱的alert提示，beta1.1','http://www.cnblogs.com/jianphu/archive/2007/10/14/923801.html',this);return false" href="/jianphu/archive/2007/10/14/923801.html#"><FONT color=#223355>收藏</FONT></A> 所属分类: <A href="/jianphu/category/84885.html"><FONT color=#223355>Asp.net问题总结</FONT></A> 、<A href="/jianphu/category/94035.html"><FONT color=#223355>JS&amp;AJAX问题</FONT></A> 、<A href="/jianphu/category/94036.html"><FONT color=#223355>JS脚本收藏</FONT></A> <IMG height=1 src="/jianphu/aggbug/923801.html?webview=1" width=1> <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/jianphu/archive/2007/10/14/923801.html"
dc:identifier="http://www.cnblogs.com/jianphu/archive/2007/10/14/923801.html"
dc:title="仿163邮箱的alert提示，beta1.1"
trackback:ping="http://www.cnblogs.com/jianphu/services/trackbacks/923801.aspx" />
</rdf:RDF>
--></DIV>
<DIV class=postbody>
<P><IMG height=184 alt="" src="http://www.cnblogs.com/images/cnblogs_com/jianphu/163msgalert.JPG" width=449 border=0><BR></P>
<P>这次美化了一下窗体，可是上次网友说的滚动条的Bug，试了好多方法一直没有好的，哪位好心的网友能告诉我js应该怎么写啊，谢谢了。我会继续努力的<BR></P>
<P>不会PS，本来想把图片都整合在一起的<BR></P>
<P>这里下载</P><A href="/Files/jianphu/163msgalert.rar" target=_blank><FONT color=#1d58d1>http://www.cnblogs.com/Files/jianphu/163msgalert.rar</FONT></A> </DIV><img src ="http://www.cnblogs.com/gjahead/aggbug/924001.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41273/" target="_blank">[新闻]中国互联网历史上最伟大的产品TOP10（二）</a>]]></description></item><item><title>好久都没有写东西了</title><link>http://www.cnblogs.com/gjahead/archive/2007/09/28/909339.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Fri, 28 Sep 2007 06:03:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/09/28/909339.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/909339.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/09/28/909339.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/909339.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/909339.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;看看这个月学的东西也不多，更没有写过任何东西，人却还那么累，为什么呢？从今天开始不管以后再忙都要坚持学习，坚持写东西！希望大家监督我哈！呵呵呵<IMG height=19 src="http://www.cnblogs.com/Emoticons/75_75.gif" width=19 border=0><img src ="http://www.cnblogs.com/gjahead/aggbug/909339.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41271/" target="_blank">[新闻]盖茨官方否认天价租楼看奥运 纯属地产商炒作</a>]]></description></item><item><title>终于用上CodeSmith4.0了，跟大家一起分享</title><link>http://www.cnblogs.com/gjahead/archive/2007/09/09/887760.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Sun, 09 Sep 2007 13:49:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/09/09/887760.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/887760.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/09/09/887760.html#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/887760.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/887760.html</trackback:ping><description><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 找了好久终于找到个可以使用的CodeSmith4.0和对应的注册机，好高兴，还没来得急看新的版本里有些什么不同，本来想发上来跟大家分享，可是由于太大了发不上来，需要的请跟我联系，我发给你！</P><img src ="http://www.cnblogs.com/gjahead/aggbug/887760.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41270/" target="_blank">[新闻]2008年7月24日IT博客精选</a>]]></description></item><item><title>XSLT基本语法和第一个实例</title><link>http://www.cnblogs.com/gjahead/archive/2007/08/22/865927.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Wed, 22 Aug 2007 11:45:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/08/22/865927.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/865927.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/08/22/865927.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/865927.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/865927.html</trackback:ping><description><![CDATA[人家都说XSLT转换技术是XML的一项重要技术，俺也没有机会在项目里运用，就在网上瞎搜搜，找点学习学习，所以下面我写的自己的学习结果有可能跟哪位老兄有些许雷同，纯属巧合哈，先申明。<BR>首先说下XSL的主要语句：<BR>
<TABLE width="80%" border=1>
<TBODY>
<TR>
<TD align=middle width="30%"><STRONG>主要语句</STRONG></TD>
<TD align=middle width="50%"><STRONG>含&nbsp; 义</STRONG></TD></TR>
<TR>
<TD width="30%">xsl:stylesheet</TD>
<TD width="50%">声明语句</TD></TR>
<TR>
<TD width="30%">xsl:template</TD>
<TD width="50%">相当于<A href="http://www.baidu.com/baidu?tn=jbh270&amp;word=site:33369.com" target=_blank><U><FONT color=#0000ff>编程</FONT></U></A>中函数的概念</TD></TR>
<TR>
<TD width="30%">xsl:template match = ""</TD>
<TD width="50%">相当于函数调用，去匹配引号中指定的节点</TD></TR>
<TR>
<TD width="30%">xsl:apply-templates</TD>
<TD width="50%">应用模板函数</TD></TR>
<TR>
<TD width="30%">xsl:apply-templates select =""</TD>
<TD width="50%">应用模板函数的调用，跳转到引号中指定的模板</TD></TR>
<TR>
<TD width="30%">xsl:for-each select = ""</TD>
<TD width="50%">循环语句，遍历与引号中的属性值相同的节点</TD></TR>
<TR>
<TD width="30%">xsl:value-of select = ""</TD>
<TD width="50%">赋值语句，取出引号中指定的属性值</TD></TR></TBODY></TABLE>上面就是最常用地语句，下面我们来看看具体的实例：<BR>my.xml文件
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">xml&nbsp;version</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1.0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;encoding</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">GB2312</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">xml</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">stylesheet&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">text/xsl</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;href</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">mystyle.xsl</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Books</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Book&nbsp;ID</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">a001</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Type</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">True</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Type</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">网络指南</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">13.2</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Book</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Book&nbsp;ID</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">a002</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Type</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">False</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Type</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">局域网技术</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">25.5</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Book</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">Books</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV>这个就不再多说了，大家都应该知道的哈！<BR>mystyle.xsl<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;?</SPAN><SPAN style="COLOR: #000000">xml&nbsp;version</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1.0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;encoding</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">GB2312</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">version-版本，encoding-语言</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:stylesheet&nbsp;version</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1.0</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;xmlns:xsl</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://www.w3.org/1999/XSL/Transform</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:template&nbsp;match</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">匹配XML所有的节点</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">html</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">table&nbsp;border</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;bgcolor</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">blue</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">tr</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">Type1</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">th</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">tr</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">each&nbsp;select</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Books/Book</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">循环Books/Book，可以取他的所有节点</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">tr</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">选择的一种</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;　</SPAN><SPAN style="COLOR: #000000">&lt;!--&lt;</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;&lt;</SPAN><SPAN style="COLOR: #000000">xsl:</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;test</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Type1='True'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">男</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">选择的另一种，当Type1='True'时显示男，其它显示女</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:choose</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:when&nbsp;test</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Type1='True'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;男<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:when</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">xsl:otherwise</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;女<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:otherwise</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:choose</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">显示XML文件里Name节点的值</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">　　　　　　</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;&lt;</SPAN><SPAN style="COLOR: #000000">xsl:value</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">of&nbsp;select</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　　　</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;&lt;</SPAN><SPAN style="COLOR: #000000">xsl:value</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">of&nbsp;select</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Price</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">td</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">tr</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">each</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　　　</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">table</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>　　&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">html</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:template</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">xsl:stylesheet</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV>之后我们用浏览器打开XML文件，出现如下结果：<BR>
<P align=center><IMG height=152 src="http://www.cnblogs.com/images/cnblogs_com/gjahead/xianshi.JPG" width=226></P><img src ="http://www.cnblogs.com/gjahead/aggbug/865927.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41269/" target="_blank">[新闻]TOM在线与Joost正式组建合资公司</a>]]></description></item><item><title>扩展TreeView控件(1) - 联动复选框（复选框的全选和取消全选）(转）</title><link>http://www.cnblogs.com/gjahead/archive/2007/08/20/862913.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Mon, 20 Aug 2007 09:04:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/08/20/862913.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/862913.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/08/20/862913.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/862913.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/862913.html</trackback:ping><description><![CDATA[摘要: TreeView既强大又好用。为了让它更强大、更好用，我们来写一个继承自TreeView的控件。[源码下载]扩展TreeView控件(1) - 联动复选框（复选框的全选和取消全选）作者：webabcd介绍扩展TreeView控件：联动复选框（复选框的全选和取消全选）。选中指定的父复选框，则设置其所有子复选框为选中状态；取消选中指定的父复选框，则设置其所有子复选框为取消选中状态。如果某父复选框的所有&nbsp;&nbsp;<a href='http://www.cnblogs.com/gjahead/archive/2007/08/20/862913.html'>阅读全文</a><img src ="http://www.cnblogs.com/gjahead/aggbug/862913.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41268/" target="_blank">[新闻]财富:谷歌副总裁称其新闻搜索值1亿美元</a>]]></description></item><item><title>动态地生成用户输入的函数表达式(C#) （转）</title><link>http://www.cnblogs.com/gjahead/archive/2007/08/18/861166.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Sat, 18 Aug 2007 13:02:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/08/18/861166.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/861166.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/08/18/861166.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/861166.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/861166.html</trackback:ping><description><![CDATA[我在一篇随笔“<A href="http://skyivben.cnblogs.com/archive/2005/10/26/262133.html"><FONT color=#1d58d1>画函数图形的C#程序，兼论一个病态函数</FONT></A>”中提到： 
<FIELDSET>这个画函数图形的C#程序有一个严重的缺点，就是函数表达式是直接写的源程序中的，不能象SciLab和Matlab那样交互式地输入。不知道用 System.Reflection.Emit.ILGenerator 类能不能动态地生成用户输入的函数表达式？</FIELDSET> “<A href="http://skyiv.cnblogs.com/" target=_blank><FONT color=#1d58d1>空间/IV</FONT></A>”在该随笔的评论中指出： <BR>
<FIELDSET>关于动态地生成用户输入的函数表达式, 看看下面这个帖子说不定有帮助: <BR><A href="http://community.csdn.net/Expert/topic/4169/4169185.xml" target=_new><FONT color=#1d58d1>http://community.csdn.net/Expert/topic/4169/4169185.xml</FONT></A> </FIELDSET> 经研究，我写了一个动态地生成用户输入的函数表达式的类(class Expression)，表达式使用 C# 语法，可带一个的自变量(x)，其自变量和值均为“double”类型。下面是测试程序的运行结果： <BR>
<FIELDSET>C&gt; ExpressionTest <BR>Usage: ExpressionTest expression [ parameters ... ] 
<P></P>
<P>C&gt; ExpressionTest Math.PI*Math.E 0 <BR>f(x): Math.PI*Math.E <BR>f(0) = 8.53973422267357 </P>
<P>C&gt; ExpressionTest Math.Pow(2,x) 0 10 49 50 1024 -1 -1024 <BR>f(x): Math.Pow(2,x) <BR>f(0) = 1 <BR>f(10) = 1024 <BR>f(49) = 562949953421312 <BR>f(50) = 1.12589990684262E+15 <BR>f(1024) = 正无穷大 <BR>f(-1) = 0.5 <BR>f(-1024) = 5.562684646268E-309 </P>
<P>C&gt; ExpressionTest "double u = Math.PI - x; double pi2 = Math.PI * Math.PI; return 3 * x * x + Math.Log(u * u) / pi2 / pi2 + 1;" 3.13 3.14 3.15 3.16 3.1416 <BR>f(x): double u = Math.PI - x; double pi2 = Math.PI * Math.PI; return 3 * x * x + Math.Log(u * u) / pi2 / pi2 + 1; <BR>f(3.13) = 30.2991811562164 <BR>f(3.14) = 30.44652582187 <BR>f(3.15) = 30.6693849404716 <BR>f(3.16) = 30.8747746902426 <BR>f(3.1416) = 30.3662371931734 </P></FIELDSET>其中最后一个例子就是我在随笔“<A href="http://skyivben.cnblogs.com/archive/2005/10/26/262133.html"><FONT color=#1d58d1>画函数图形的C#程序，兼论一个病态函数</FONT></A>”的下列函数的计算结果： <BR>
<FIELDSET>实际上这个病态函数是<A href="http://www.dearbook.com.cn/book/ViewBook.aspx?pno=TS0022737"><FONT color=#1d58d1>《C数值算法(第二版)》</FONT></A>第三章“内插法和外推法”中提到的： 
<P>--------------------------------------------------------------------------- <BR><SPAN style="FONT-FAMILY: Comic Sans MS">可以很容易地构造一些病态函数使内插法失败。例如，考虑函数&nbsp; <BR>f(x) = 3 * x<SUP>2</SUP> + π<SUP>-4</SUP> * ln[(π-x)<SUP>2</SUP>] + 1 <BR>它除了 x = π 之外都有定义，而 x = π 时无定义，其它情况，值有正有负。而这函数在任何基于数值 x = 3.13, 3.14, 3.15, 3.16 的插值法，都肯定在 x = 3.1416 处得到一个错误的解，尽管通过这五个点所画的曲线确实相当平滑!(用计算器试试看。)</SPAN> <BR>--------------------------------------------------------------------------- </P></FIELDSET>可以看出，而这函数在任何基于数值 x = 3.13, 3.14, 3.15, 3.16 的插值法，在 x = 3.1416 处得到的解肯定在 30.44652582187 和 30.6693849404716 之间，但实际的解应该是 30.3662371931734，所以说作者断言在该处肯定会得到一个错误的解。 <BR>下面就是源程序： <BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;ExpressionTest.cs&nbsp;-&nbsp;动态生成数学表达式并计算其值的测试程序 <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;编译方法:&nbsp;csc&nbsp;ExpressionTest.cs&nbsp;Expression.cs</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;Skyiv.Util; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Skyiv.Test <BR><IMG id=Codehighlighter1_143_779_Open_Image onclick="this.style.display='none'; Codehighlighter1_143_779_Open_Text.style.display='none'; Codehighlighter1_143_779_Closed_Image.style.display='inline'; Codehighlighter1_143_779_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_143_779_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_143_779_Closed_Text.style.display='none'; Codehighlighter1_143_779_Open_Image.style.display='inline'; Codehighlighter1_143_779_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top></SPAN><SPAN id=Codehighlighter1_143_779_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_143_779_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;ExpressionTest <BR><IMG id=Codehighlighter1_170_777_Open_Image onclick="this.style.display='none'; Codehighlighter1_170_777_Open_Text.style.display='none'; Codehighlighter1_170_777_Closed_Image.style.display='inline'; Codehighlighter1_170_777_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_170_777_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_170_777_Closed_Text.style.display='none'; Codehighlighter1_170_777_Open_Image.style.display='inline'; Codehighlighter1_170_777_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_170_777_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_170_777_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;[]&nbsp;args) <BR><IMG id=Codehighlighter1_213_773_Open_Image onclick="this.style.display='none'; Codehighlighter1_213_773_Open_Text.style.display='none'; Codehighlighter1_213_773_Closed_Image.style.display='inline'; Codehighlighter1_213_773_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_213_773_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_213_773_Closed_Text.style.display='none'; Codehighlighter1_213_773_Open_Image.style.display='inline'; Codehighlighter1_213_773_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_213_773_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_213_773_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"> <BR><IMG id=Codehighlighter1_231_676_Open_Image onclick="this.style.display='none'; Codehighlighter1_231_676_Open_Text.style.display='none'; Codehighlighter1_231_676_Closed_Image.style.display='inline'; Codehighlighter1_231_676_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_231_676_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_231_676_Closed_Text.style.display='none'; Codehighlighter1_231_676_Open_Image.style.display='inline'; Codehighlighter1_231_676_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_231_676_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_231_676_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(args.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">) <BR><IMG id=Codehighlighter1_270_581_Open_Image onclick="this.style.display='none'; Codehighlighter1_270_581_Open_Text.style.display='none'; Codehighlighter1_270_581_Closed_Image.style.display='inline'; Codehighlighter1_270_581_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_270_581_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_270_581_Closed_Text.style.display='none'; Codehighlighter1_270_581_Open_Image.style.display='inline'; Codehighlighter1_270_581_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_270_581_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_270_581_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">f(x):&nbsp;{0}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;args[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Expression&nbsp;expression&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Expression(args[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">;&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;args.Length;&nbsp;i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">) <BR><IMG id=Codehighlighter1_440_571_Open_Image onclick="this.style.display='none'; Codehighlighter1_440_571_Open_Text.style.display='none'; Codehighlighter1_440_571_Closed_Image.style.display='inline'; Codehighlighter1_440_571_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_440_571_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_440_571_Closed_Text.style.display='none'; Codehighlighter1_440_571_Open_Image.style.display='inline'; Codehighlighter1_440_571_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_440_571_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_440_571_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;x&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">.Parse(args[i]); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">f({0})&nbsp;=&nbsp;{1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;x,&nbsp;expression.Compute(x)); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Usage:&nbsp;ExpressionTest&nbsp;expression&nbsp;[&nbsp;parameters&nbsp;<IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15>&nbsp;]</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(Exception&nbsp;ex) <BR><IMG id=Codehighlighter1_711_767_Open_Image onclick="this.style.display='none'; Codehighlighter1_711_767_Open_Text.style.display='none'; Codehighlighter1_711_767_Closed_Image.style.display='inline'; Codehighlighter1_711_767_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_711_767_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_711_767_Closed_Text.style.display='none'; Codehighlighter1_711_767_Open_Image.style.display='inline'; Codehighlighter1_711_767_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_711_767_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_711_767_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">错误:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;ex.Message); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" width=11 align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN> </DIV>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;Expression.cs&nbsp;-&nbsp;动态生成数学表达式并计算其值 <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;表达式使用&nbsp;C#&nbsp;语法，可带一个的自变量(x)。 <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;表达式的自变量和值均为(double)类型。 <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;使用举例: <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;Expression&nbsp;expression&nbsp;=&nbsp;new&nbsp;Expression("Math.Sin(x)"); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;Console.WriteLine(expression.Compute(Math.PI&nbsp;/&nbsp;2)); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;expression&nbsp;=&nbsp;new&nbsp;Expression("double&nbsp;u&nbsp;=&nbsp;Math.PI&nbsp;-&nbsp;x;"&nbsp;+ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"double&nbsp;pi2&nbsp;=&nbsp;Math.PI&nbsp;*&nbsp;Math.PI;"&nbsp;+ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"return&nbsp;3&nbsp;*&nbsp;x&nbsp;*&nbsp;x&nbsp;+&nbsp;Math.Log(u&nbsp;*&nbsp;u)&nbsp;/&nbsp;pi2&nbsp;/&nbsp;pi2&nbsp;+&nbsp;1;"); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;Console.WriteLine(expression.Compute(0));</SPAN><SPAN style="COLOR: #008000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.CodeDom.Compiler; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;Microsoft.CSharp; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Reflection; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Skyiv.Util <BR><IMG id=Codehighlighter1_564_1642_Open_Image onclick="this.style.display='none'; Codehighlighter1_564_1642_Open_Text.style.display='none'; Codehighlighter1_564_1642_Closed_Image.style.display='inline'; Codehighlighter1_564_1642_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_564_1642_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_564_1642_Closed_Text.style.display='none'; Codehighlighter1_564_1642_Open_Image.style.display='inline'; Codehighlighter1_564_1642_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width=11 align=top></SPAN><SPAN id=Codehighlighter1_564_1642_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_564_1642_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">sealed</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;Expression <BR><IMG id=Codehighlighter1_594_1640_Open_Image onclick="this.style.display='none'; Codehighlighter1_594_1640_Open_Text.style.display='none'; Codehighlighter1_594_1640_Closed_Image.style.display='inline'; Codehighlighter1_594_1640_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_594_1640_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_594_1640_Closed_Text.style.display='none'; Codehighlighter1_594_1640_Open_Image.style.display='inline'; Codehighlighter1_594_1640_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_594_1640_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_594_1640_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">&nbsp;instance; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;MethodInfo&nbsp;method; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Expression(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;expression) <BR><IMG id=Codehighlighter1_690_1516_Open_Image onclick="this.style.display='none'; Codehighlighter1_690_1516_Open_Text.style.display='none'; Codehighlighter1_690_1516_Closed_Image.style.display='inline'; Codehighlighter1_690_1516_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_690_1516_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_690_1516_Closed_Text.style.display='none'; Codehighlighter1_690_1516_Open_Image.style.display='inline'; Codehighlighter1_690_1516_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_690_1516_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_690_1516_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(expression.IndexOf(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">return</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)&nbsp;expression&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">return&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;expression&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;className&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Expression</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;methodName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Compute</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilerParameters&nbsp;p&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;CompilerParameters(); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p.GenerateInMemory&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CompilerResults&nbsp;cr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;CSharpCodeProvider().CompileAssemblyFromSource(p,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">. <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">using&nbsp;System;sealed&nbsp;class&nbsp;{0}{{public&nbsp;double&nbsp;{1}(double&nbsp;x){{{2}}}}}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;className,&nbsp;methodName,&nbsp;expression)); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(cr.Errors.Count&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">) <BR><IMG id=Codehighlighter1_1201_1389_Open_Image onclick="this.style.display='none'; Codehighlighter1_1201_1389_Open_Text.style.display='none'; Codehighlighter1_1201_1389_Closed_Image.style.display='inline'; Codehighlighter1_1201_1389_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_1201_1389_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1201_1389_Closed_Text.style.display='none'; Codehighlighter1_1201_1389_Open_Image.style.display='inline'; Codehighlighter1_1201_1389_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1201_1389_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_1201_1389_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;msg&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Expression(\</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">&nbsp;+&nbsp;expression&nbsp;+&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">):&nbsp;\n</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">&nbsp;(CompilerError&nbsp;err&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN><SPAN style="COLOR: #000000">&nbsp;cr.Errors)&nbsp;msg&nbsp;</SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000">&nbsp;err.ToString()&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\n</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Exception(msg); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;cr.CompiledAssembly.CreateInstance(className); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;method&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;instance.GetType().GetMethod(methodName); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp; <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;Compute(</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">&nbsp;x) <BR><IMG id=Codehighlighter1_1563_1636_Open_Image onclick="this.style.display='none'; Codehighlighter1_1563_1636_Open_Text.style.display='none'; Codehighlighter1_1563_1636_Closed_Image.style.display='inline'; Codehighlighter1_1563_1636_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_1563_1636_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1563_1636_Closed_Text.style.display='none'; Codehighlighter1_1563_1636_Open_Image.style.display='inline'; Codehighlighter1_1563_1636_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1563_1636_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_1563_1636_Open_Text><SPAN style="COLOR: #000000">{ <BR><IMG id=Codehighlighter1_1624_1628_Open_Image onclick="this.style.display='none'; Codehighlighter1_1624_1628_Open_Text.style.display='none'; Codehighlighter1_1624_1628_Closed_Image.style.display='inline'; Codehighlighter1_1624_1628_Closed_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width=11 align=top><IMG id=Codehighlighter1_1624_1628_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1624_1628_Closed_Text.style.display='none'; Codehighlighter1_1624_1628_Open_Image.style.display='inline'; Codehighlighter1_1624_1628_Open_Text.style.display='inline';" height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">)method.Invoke(instance,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">&nbsp;[]&nbsp;</SPAN><SPAN id=Codehighlighter1_1624_1628_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG height=20 src="http://www.cnblogs.com/images/dot.gif" width=15></SPAN><SPAN id=Codehighlighter1_1624_1628_Open_Text><SPAN style="COLOR: #000000">{&nbsp;x&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">); <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width=11 align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" width=11 align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"> <BR><IMG height=16 src="http://skyivben.cnblogs.com/Images/OutliningIndicators/None.gif" width=11 align=top></SPAN> </DIV>在这里向 <A href="http://www.csdn.net/"><FONT color=#1d58d1>CSDN</FONT></A> 论坛的“<FONT color=#3366cc><STRONG>LoveCherry(论成败，人生豪迈；大不了，重头再来！^_^) </STRONG></FONT>”表示感谢，我的程序就是在他的程序的基础上发展而来的。 <img src ="http://www.cnblogs.com/gjahead/aggbug/861166.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41267/" target="_blank">[新闻]Ubuntu创始人呼吁开发Linux桌面软件对抗苹果</a>]]></description></item><item><title>画函数图形的C#程序(改进版) （转）</title><link>http://www.cnblogs.com/gjahead/archive/2007/08/18/861164.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Sat, 18 Aug 2007 13:01:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/08/18/861164.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/861164.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/08/18/861164.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/861164.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/861164.html</trackback:ping><description><![CDATA[摘要: 我在10月份发表过一篇随笔“画函数图形的C#程序，兼论一个病态函数”，在那篇随笔中写道： 这个画函数图形的C#程序有一个严重的缺点，就是函数表达式是直接写的源程序中的，不能象SciLab和Matlab那样交互式地输入。 后来，根据“空间/IV”的评论，我写了个动态生成用户输入的函数表达式的类，用以改进这个画函数图形的C#程序。下面是该程序的运行效果： 可以看到，不但要画的函数的表达式可以由用户动态&nbsp;&nbsp;<a href='http://www.cnblogs.com/gjahead/archive/2007/08/18/861164.html'>阅读全文</a><img src ="http://www.cnblogs.com/gjahead/aggbug/861164.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41267/" target="_blank">[新闻]Ubuntu创始人呼吁开发Linux桌面软件对抗苹果</a>]]></description></item><item><title>画函数图形的C#程序，兼论一个病态函数 （转）</title><link>http://www.cnblogs.com/gjahead/archive/2007/08/18/861162.html</link><dc:creator>过江</dc:creator><author>过江</author><pubDate>Sat, 18 Aug 2007 13:00:00 GMT</pubDate><guid>http://www.cnblogs.com/gjahead/archive/2007/08/18/861162.html</guid><wfw:comment>http://www.cnblogs.com/gjahead/comments/861162.html</wfw:comment><comments>http://www.cnblogs.com/gjahead/archive/2007/08/18/861162.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/gjahead/comments/commentRss/861162.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/gjahead/services/trackbacks/861162.html</trackback:ping><description><![CDATA[摘要: 该程序在屏幕上画出指定的函数的图像，函数的自变量的取值范围由用户指定，程序自动计算该区间内函数的值的取值范围。首先，让我们来看一幅正弦函数: f(x) = sin(x) 的图像：  这幅图像中，ClientSize: 529x152 表示该程序画图区宽度为 529 个像素，高度为 152 个像素。该函数自变量 x 的取值范围从 -3.5 到 3.5，函数值 y 的取值范围应该是从 -1 到 1，但&nbsp;&nbsp;<a href='http://www.cnblogs.com/gjahead/archive/2007/08/18/861162.html'>阅读全文</a><img src ="http://www.cnblogs.com/gjahead/aggbug/861162.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41267/" target="_blank">[新闻]Ubuntu创始人呼吁开发Linux桌面软件对抗苹果</a>]]></description></item></channel></rss>