悬赏园豆:10
[已解决问题]
解决于 2008-07-15 18:39
<P>我想用WebForm测试一些c#程序,觉得用控制台应用程序比较麻烦,我是这样写的</P>
<P>using System;<BR>using System.Data;<BR>using System.Configuration;<BR>using System.Collections;<BR>using System.Web;<BR>using System.Web.Security;<BR>using System.Web.UI;<BR>using System.Web.UI.WebControls;<BR>using System.Web.UI.WebControls.WebParts;<BR>using System.Web.UI.HtmlControls;</P>
<P>public partial class test : System.Web.UI.Page<BR>{<BR> protected void Page_Load(object sender, EventArgs e)<BR> {<BR> B b = new B();<BR> A a = new A();<BR> a.Fun2(b);<BR> b.Fun2(a);<BR> }<BR>}</P>
<P>public class A<BR>{<BR> public virtual void Fun1(int i)<BR> {<BR> Console.WriteLine(i);<BR> }</P>
<P> public void Fun2(A a)<BR> {<BR> a.Fun1(1);<BR> Fun1(5);<BR> }<BR>}</P>
<P>public class B : A<BR>{<BR> public override void Fun1(int i)<BR> {<BR> base.Fun1(i + 1);<BR> }<BR>}</P>
<P>结果什么都输不出,是不是不能这样测试,还是我写错了</P>