1.举例说明new关键字可用于哪些方面。
2.sealed关键字的作用是什么?什么情况下需要使用sealed关键字?
3.哪些关键字可用于版本控制?
====================================================
附70-315试题
You are a Web developer for Test104. Test104 has just merged with RealPass Inc. Now,you are required to perform migration of RealPass's ASP-based Web page named ProductsList.asp to ASP.NET. You want to deploy the ASP.NET version of your Web page with the minimum amount of development effort.You also want the migration th be accomplished as quickly as possible.
The page contains a COM component named Test104.ProductsList. The component is written in Microsoft Visual Basic 6.0. When you open the new page,you receive the following error message:"Server error - The component 'Test104.ProductsList' cannot be created." You need to ensure that you can open the Web page successfully. What should you do?A.Write a manage component to perform the tasks that the Test104. ProductsList component currently performs.
B.Add the following line of code to the Page. Load event handler.
C.RegisterRequiresPostBack("Test104.ProductsList")
D.Add the following attribute to the processModell element of the Web.config file: comlmpersonationLever=Delegate
E.Set the AspCompat attribute of the Page directive to true.

解决方案 »

  1.   

    new 关键字用于子类的方法重写父类的方法sealed表示类或方法不能被继承或重写
      

  2.   

    1、new--新建实例,屏弊基类成员
    2、sealed-防止被继承,没用过
    3、不清楚
      

  3.   

    俺是C#初学者,想考个MCAD证书,大家一起学啊!
      

  4.   

    E??这个问题我在回答一个jmail的安装问题回答过,用vb6的组件在iis6上不能用的问题,黄震宇在天极答的,这段e文我看的是个大概其,也许没看对,当时的回答就是在配置属性的时候去允许什么东东的
      

  5.   

    想请问一下楼主,哪里可以搞到这些mcsd的题目呢,谢谢了
      

  6.   

    假设你是Test104公司的一个Web程序员。Test104刚刚与RealPass公司合并。现在需要你干一件事情:把原先RealPass的一个ASP页面ProductsList.asp移植到ASP.NET下面。你要花费最小的力气去部署这个ASP.NET版本的Web页,而且这项移植工作还要越快完成越好。这个页面上包含了一个名为Test104.ProductsList的COM组件,这个组件是用VB6写的。可是当你打开新页的时候,却蹦出了这么个错误:
    Server error - The component 'Test104.ProductsList' cannot be created.(这个就不要我翻译了吧)
    身为高手的你必须搞定这个错误!那么你该怎么做呢?
    (译者注:靠,这次怎么选项也要翻译)
    A、重写一个托管的组件来实现Test104.ProductsList的功能;
    B、在页面里添加下面这行代码,(译者注:代码在哪啊?)加载事件处理程序;
    C、RegisterRequiresPostBack("Test104.ProductsList")
    D、在web.config中为processModel元素增加这个属性:comlmpersonationLever=Delegate
    E、把页面的AspCompat属性设为true这次的我就不会了,因为我在.net下面用过com的地图控件,问题多多,自己也解决不了,如果逼我,我宁愿选A     :P
      

  7.   

    参考答案:
    1.举例说明new关键字可用于哪些方面。
      答:在C#中,new关键字可用作运算符或修饰符。作为运算符,用于在堆上创建对象和调用构造函数;作为修饰符,用于隐藏基类成员的继承成员。
    2.sealed关键字的作用是什么?什么情况下需要使用sealed关键字?
      答:在类声明中使用sealed修饰符可防止其它类继承此类。在方法声明中使用sealed修饰符可防止扩充类重写此方法。
          sealed修饰符主要用于防止非有意的派生,另外它还能促使某些运行时的优化。具体说来,由于密封类永远不会有任何派生类,所以对密封类实例的虚拟函数成员的调用可以转换为非虚拟调用来处理。
    3.哪些关键字可用于版本控制?
      答:override关键字和new关键字均可用于版本控制。
      在C#中,默认情况下方法不是虚拟的。若要使方法称为虚拟方法,必须在基类的方法声明中使用virtual修饰符。然后,派生类可以使用override关键字重写基类中的虚拟方法,或使用new关键字隐藏基类中的虚拟方法。如果override关键字和new关键字均未指定,编译器将发出警告,并且派生类中的方法将隐藏基类中的方法。
      

  8.   

    英文题注释:
    If the older file contains calls to COM components -for example,ADO code then we must add the AspCompat attribute to the page directive in HTML view. The aspcompat attribute forces the page to execute in single-threaded(STA)mode.