• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 124,  comments - 29,  trackbacks - 0

            XML文檔如下:
            <?xml version="1.0" encoding="utf-8"?>
            <ftpHelp>
              <ftpServer1 NetName="ne1" ServerIP="www.whvideo.cn" ServerPath="/logfiles/W3SVC180" LocalPath="D:/MyWork/download1" UserName="antistone" Password="loginlogout" TimeInterval="15">
              </ftpServer1>
              <ftpServerne2 NetName="ne2" ServerIP="ftp.sjtu.edu.cn" ServerPath="/html/css" LocalPath="D:/MyWork/download2" UserName="" Password="" TimeInterval="15" />
              <ftpServerne3 NetName="ne3" ServerIP="219.231.160.2" ServerPath="/111" LocalPath="D:/MyWork" UserName="lm" Password="113762" TimeInterval="15" />
            </ftpHelp>

            XML文檔中生成節點
                     XmlDocument xmlDoc = new XmlDocument();
                      xmlDoc.Load("FtpHelp.xml");
                      XmlNode node = xmlDoc.SelectSingleNode("ftpHelp");
                      String cndName = "ftpServer" + this.txtNeName.Text;
                      XmlElement cnd = xmlDoc.CreateElement(cndName);
                      cnd.SetAttribute("NetName", txtNeName.Text);
                      cnd.SetAttribute("ServerIP", txtServerIP.Text);
                      cnd.SetAttribute("ServerPath", txtSerPath.Text);
                      cnd.SetAttribute("LocalPath", txtLocalPath.Text);
                      cnd.SetAttribute("UserName", txtUserName.Text);
                      cnd.SetAttribute("Password", txtPassword.Text);
                      cnd.SetAttribute("NetName", txtNeName.Text);
                      cnd.SetAttribute("TimeInterval", txtTimeInterval.Text);
                      node.AppendChild(cnd);
                      xmlDoc.Save("FtpHelp.xml");

            xml文檔中遍歷查詢節點

                        String neName = txtNeName.Text;
                        XmlDocument xmlDoc = new XmlDocument();
                        xmlDoc.Load("FtpHelp.xml");
                        XmlNode node = xmlDoc.SelectSingleNode("ftpHelp");
                        foreach (XmlNode nd in node.ChildNodes)
                        {
                            if (nd.Attributes["NetName"].Value == neName)
                            {
                              MessageBox.Show("該網元已注冊,注冊信息為:","提示");
                              this.plNeInfo.Visible = true;
                              txtServerIP.Text = nd.Attributes["ServerIP"].Value;
                              txtSerPath.Text = nd.Attributes["ServerPath"].Value;
                              txtLocalPath.Text=nd.Attributes["LocalPath"].Value;
                              txtUserName.Text = nd.Attributes["UserName"].Value;
                              txtPassword.Text = nd.Attributes["Password"].Value;
                              txtTimeInterval.Text = nd.Attributes["TimeInterval"].Value;
                              this.btnAdd.Visible = false;
                              return;
                            }
                        }
                        MessageBox.Show("該網元不存在,請注冊","提示");



             private List<NeFtpInfo> GetXmlInfo(String fileName,List<String> neNameList)
                    {
                        if (neNameList!=null)
                        {
                            List<NeFtpInfo> neInList = new List<NeFtpInfo>();
                            XmlDocument xmlDoc = new XmlDocument();
                            xmlDoc.Load(fileName);
                            XmlNode node = xmlDoc.SelectSingleNode("ftpHelp");

                            for (int i = 0; i < neNameList.Count; i++)
                            {
                                NeFtpInfo ni = new NeFtpInfo();
                                String neName = neNameList[i];
                                int j = 0;
                                for (j = 0; j < node.ChildNodes.Count; j++)
                                {
                                    XmlNode nd = node.ChildNodes[j];
                                    if (nd.Attributes["NetName"].Value == neName)
                                    {
                                        ni.NeName = neName;
                                        ni.ServerIP = nd.Attributes["ServerIP"].Value;
                                        ni.ServerPath = nd.Attributes["ServerPath"].Value;
                                        ni.LocalPath = nd.Attributes["LocalPath"].Value;
                                        ni.UserName = nd.Attributes["UserName"].Value;
                                        ni.Password = nd.Attributes["Password"].Value;
                                        ni.IntervalTime = nd.Attributes["TimeInterval"].Value;
                                        neInList.Add(ni);
                                        break;
                                    }
                                }
                                if (j == node.ChildNodes.Count)
                                {
                                    MessageBox.Show("網元" + neName + "沒有注冊過相關信息", "提示");
                                }
                            }
                            return neInList;
                        }
                        else
                        {
                            return null;
                        }
                    }

            posted on 2008-09-25 15:41 天書 閱讀(151) 評論(0)  編輯 收藏 引用

            <2008年9月>
            31123456
            78910111213
            14151617181920
            21222324252627
            2829301234
            567891011

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            999久久久免费国产精品播放| 免费一级欧美大片久久网| 久久精品国产久精国产果冻传媒| 国产成人精品综合久久久久 | 久久香蕉国产线看观看99| 国产精品美女久久久久网| 久久久久国产精品嫩草影院| 亚洲精品无码久久久久久| 国产精品久久久久影视不卡| 亚洲国产精品综合久久一线| 午夜人妻久久久久久久久| 九九久久精品国产| 97久久综合精品久久久综合| 欧美性大战久久久久久| 国产欧美一区二区久久| 久久精品成人欧美大片| 久久久久国色AV免费观看| 精品999久久久久久中文字幕 | 久久久久国产精品麻豆AR影院| 久久久亚洲欧洲日产国码是AV| 婷婷综合久久中文字幕| 国产精品无码久久综合| 国产精品成人久久久| 久久精品18| 国内精品欧美久久精品| 精品国产一区二区三区久久| 久久久久亚洲av无码专区导航| 伊人热热久久原色播放www| 女人香蕉久久**毛片精品| 久久AV高清无码| 国产精品久久影院| 久久99精品国产99久久6男男| 久久亚洲AV成人无码国产| 久久人人爽人人爽人人片AV高清| 亚洲国产精品综合久久网络| 久久中文精品无码中文字幕| 国产成人无码精品久久久久免费| yellow中文字幕久久网| 狠狠人妻久久久久久综合| 久久www免费人成精品香蕉| 99久久婷婷国产综合精品草原|