1、HashTable、SortList 、Stack、Queue之间的概念与异同
2、文件操作的命名空间,,主要成员driver与driverinfo,File与FileInfo,Directory与DirectoryInfo,能说明其异同。哪个可实例化,那些不可以
3、XML操作,使用XmlDocument与XmlTextReader 、XmlTextWrite读写XML文档,能写出这几个类的名称,并且简述其主要功能。
4、在项目中创建一个XML文件,文件的结构自定义,利用XmlElement对象来修改该文档,为该文档增加一个子节点。
5、熟悉ASCII码之间比较大小,熟悉使用选择排序或者冒泡排序对数字进行排序。

解决方案 »

  1.   

    如果需要答案,请在我的博客留言,我将给你一个PPT文件,可解决你的问题^_^
      

  2.   

    HashTable此类实现一个哈希表,该哈希表将键映射到相应的值。任何非 null 对象都可以用作键或值。为了成功地在哈希表中存储和获取对象,用作键的对象必须实现 hashCode 方法和 equals 方法。
    SortList此类表示键值对的集合,这些键值对按键排序并可按照键和索引访问.
    Stack类是后入先出的集合类,元素在堆的顶部进入堆,在顶部出堆.
    QUEUE类是先入先出的集合类,遵循FIFO的原则,元素在队列的尾部进入队列,在队列的顶部出队列.以上四个类都是派生处System.Collections.
      

  3.   

    添加一个结点:
    XmlDocument xmlDoc=new XmlDocument();
    xmlDoc.Load(Server.MapPath("data.xml"));
    XmlNode root=xmlDoc.SelectSingleNode("Employees");//查找<Employees>
    XmlElement xe1=xmlDoc.CreateElement("Node");//创建一个<Node>节点
    xe1.SetAttribute("genre","张三");//设置该节点genre属性
    xe1.SetAttribute("ISBN","1-1111-1");//设置该节点ISBN属性XmlElement xesub1=xmlDoc.CreateElement("title");
    xesub1.InnerText="C#入门帮助";//设置文本节点
    xe1.AppendChild(xesub1);//添加到<Node>节点中
    XmlElement xesub2=xmlDoc.CreateElement("author");
    xesub2.InnerText="高手";
    xe1.AppendChild(xesub2);
    XmlElement xesub3=xmlDoc.CreateElement("price");
    xesub3.InnerText="158.3";
    xe1.AppendChild(xesub3);root.AppendChild(xe1);//添加到<Employees>节点中
    xmlDoc.Save ( Server.MapPath("data.xml") );-------------------------------------------
    结果:在xml原有的内容里添加了一个结点,内容如下,
    <?xml version="1.0"?>
    <Employees>
      <Node genre="李赞红" ISBN="2-3631-4">
        <title>CS从入门到精通</title>
        <author>候捷</author>
        <price>58.3</price>
      </Node>
      <Node genre="李赞红" ISBN="2-3631-4">
        <title>CS从入门到精通</title>
        <author>候捷</author>
        <price>58.3</price>
      </Node>
      <Node genre="张三" ISBN="1-1111-1">
        <title>C#入门帮助</title>
        <author>高手</author>
        <price>158.3</price>
      </Node>
    </Employees>
      

  4.   


    冒泡排序的例子
    #include<iostream>
    using namespace std;
    int main() 

    int a[]={12,22,36,15,99,44,1,2,3,5,57};
    int i=0;
    while(i<10)
    {
    int temp=0;
    if(a[i]>a[i+1])
    {
    temp=a[i];
    a[i]=a[i+1];
    a[i+1]=temp;
    i=0;
    continue;
    }
    i++;
    }
    for(int i=0;i<=10;i++)
    {
       cout<<a[i]<<endl;
    }
    system("pause"); 
    }