• <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文檔中生成節(jié)點(diǎn)
                     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文檔中遍歷查詢(xún)節(jié)點(diǎn)

                        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("該網(wǎng)元已注冊(cè),注冊(cè)信息為:","提示");
                              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("該網(wǎng)元不存在,請(qǐng)注冊(cè)","提示");



             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("網(wǎng)元" + neName + "沒(méi)有注冊(cè)過(guò)相關(guān)信息", "提示");
                                }
                            }
                            return neInList;
                        }
                        else
                        {
                            return null;
                        }
                    }

            posted on 2008-09-25 15:41 天書(shū) 閱讀(148) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理



            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類(lèi)

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久久久亚洲AV成人网人人网站| 国产精品一区二区久久精品| 亚洲综合日韩久久成人AV| 久久se精品一区精品二区| 久久午夜无码鲁丝片秋霞| 国产成人精品久久亚洲| 精品久久久久久久久中文字幕| 国产成人精品综合久久久 | 久久最新精品国产| 久久香综合精品久久伊人| 亚洲伊人久久成综合人影院| 久久亚洲国产中v天仙www | 日韩精品久久久久久久电影| 日本精品一区二区久久久| 欧美一区二区精品久久| 女人香蕉久久**毛片精品| MM131亚洲国产美女久久| 国产精品久久久久jk制服| 高清免费久久午夜精品| 丁香五月网久久综合| 国产成人久久精品麻豆一区| 亚洲国产精品久久久久网站| 久久电影网一区| 久久精品一区二区影院| 色悠久久久久久久综合网| 婷婷国产天堂久久综合五月| 久久久久国产精品嫩草影院| 亚洲午夜无码久久久久| avtt天堂网久久精品| 国产激情久久久久影院老熟女| 久久青青草原精品国产软件 | 岛国搬运www久久| 久久精品国产亚洲av瑜伽| 久久人人青草97香蕉| 久久久久久精品成人免费图片| 久久久噜噜噜久久熟女AA片| 狠狠色婷婷综合天天久久丁香| 久久综合成人网| 久久精品中文无码资源站| 久久国产香蕉一区精品| 久久夜色精品国产欧美乱|