• <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年3月>
            2425262728291
            2345678
            9101112131415
            16171819202122
            23242526272829
            303112345

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            国内精品久久久久久久久电影网| 亚洲欧洲久久久精品| 一级做a爱片久久毛片| 国产精品99久久精品| 国产精品九九久久免费视频| 国产精品一区二区久久精品涩爱| 久久99中文字幕久久| 天天久久狠狠色综合| 一本一本久久A久久综合精品 | 精品久久久久久无码人妻蜜桃| 国产精品99久久不卡| 一本色道久久88综合日韩精品 | 国产精品日韩欧美久久综合| 9999国产精品欧美久久久久久| 久久强奷乱码老熟女网站| 久久国产精品-久久精品| 色婷婷综合久久久久中文字幕| 亚洲AV无码成人网站久久精品大| 人妻精品久久久久中文字幕69| 久久精品国产99国产电影网| 欧美精品福利视频一区二区三区久久久精品 | 国内精品久久久久国产盗摄| 精品久久久久久久久免费影院| 麻豆亚洲AV永久无码精品久久| 伊人色综合久久天天| 亚洲中文精品久久久久久不卡| 久久久久亚洲AV成人网人人网站| 色综合久久久久久久久五月| 青青青青久久精品国产h久久精品五福影院1421| 精品久久亚洲中文无码| 亚洲а∨天堂久久精品| 欧美噜噜久久久XXX| 久久久精品人妻一区二区三区蜜桃| 久久九九免费高清视频| 一本伊大人香蕉久久网手机| 国内精品人妻无码久久久影院| 久久久久人妻精品一区| 久久国产精品一国产精品金尊 | 亚洲中文字幕无码久久精品1| 亚洲精品美女久久久久99小说| 国产精品久久久天天影视香蕉|