| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 962 人关注过本帖
标题:请教!!!
只看楼主 加入收藏
ufo0303
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-1-22
收藏
 问题点数:0 回复次数:3 
请教!!!
protected void Init()  //帮忙整体的介绍下,LIVE41,拜托,谢谢!!!急!!!
  {
   this.XmlDoc = new XmlDocument();  //新建一个Xml文档
   switch(this.Type.ToLower())  // ToLower()是返回此 System.String 的小写形式的副本,返回时使用当前区域性的大小写规则。
   {
    case "form":this.XmlDoc.LoadXml("<Form Name='' ></Form>");break;
    case "list":this.XmlDoc.LoadXml("<List Name='' Fields=''></List>");break;
    case "enum":this.XmlDoc.LoadXml("<Enum Name='' ></Enum>");break;
    case "param":this.XmlDoc.LoadXml("<Param Name=''></Param>");break;
   }
   this.XmlEle=this.XmlDoc.DocumentElement;
  }
搜索更多相关主题的帖子: case XmlDoc break LoadXml 
2005-01-24 10:34
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
又来? using System; using System.IO; using System.Xml; public class Sample { public static void Main() { //Create the XmlDocument. XmlDocument doc = new XmlDocument(); doc.LoadXml("<?xml version='1.0' ?>" + "<book genre='novel' ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "</book>"); //Display the document element. Console.WriteLine(doc.DocumentElement.OuterXml); } } 大概就是根据当前输入字符来判断读取XML文件的指定段之间的内容,然后传给XmlEle(又是一个我不知道什么的定义),关键是this,this就是本文件或者本类,this.Type判断本类的类型,此处的Type是属性,但是我始终不知道你的this的定义是什么,所以没法解释。

The Type property can only be set to primitive types and enumerations.

The XmlTextAttribute can also be applied to a field that returns an XmlNode or an array of XmlNode objects.

You can apply the XmlTextAttribute to a field or property that returns an array of strings. You can also apply the attribute to an array of type Object but you must set the Type property to string. In that case, any strings inserted into the array will be serialized as XML text.

2005-01-24 11:41
ufo0303
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-1-22
收藏
得分:0 
感谢LIVE41对我的大力支持,虽然有时候帖的比较的吓人,但是你还是坚持看完,真的很谢谢你!!以后尽量一次少贴点,把说明作好,谢谢!!!
2005-01-24 17:28
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
不用感谢在下啦,你的帖子不吓人,是我没有耐性而已,不好意思。不过这里始终不是csdn,论坛里的高手们都回家过年了,很少上来回帖,要不一定有更详尽的回帖。
2005-01-24 17:38
快速回复:请教!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017240 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved