• <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é)點
                     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文檔中遍歷查詢節(jié)點

                        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)元已注冊,注冊信息為:","提示");
                              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)元不存在,請注冊","提示");



             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 + "沒有注冊過相關(guān)信息", "提示");
                                }
                            }
                            return neInList;
                        }
                        else
                        {
                            return null;
                        }
                    }

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

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

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            国产精品99久久不卡| 日本久久久久亚洲中字幕| 欧美日韩中文字幕久久伊人| 国产精品福利一区二区久久| 久久精品国产秦先生| 国产高潮国产高潮久久久91 | 青青国产成人久久91网| 青青热久久国产久精品 | 99久久免费国产精品| 久久中文字幕人妻熟av女| 99re久久精品国产首页2020| 久久亚洲av无码精品浪潮| 久久久无码精品亚洲日韩按摩| 久久久亚洲精品蜜桃臀| 97久久久久人妻精品专区| 久久久久久曰本AV免费免费| 久久久久国产一级毛片高清板| 亚洲精品无码久久久久去q| 国内精品久久久久久久影视麻豆| 久久丫精品国产亚洲av| 久久久久久久91精品免费观看| 久久久久综合网久久| 精品久久久久久国产潘金莲| 亚洲中文字幕无码久久精品1| 久久综合精品国产一区二区三区| 免费精品99久久国产综合精品| 亚洲AV日韩AV永久无码久久| 一本久久免费视频| 亚洲国产成人精品女人久久久 | 99久久免费国产特黄| 伊人久久综合成人网| 国产综合免费精品久久久| 狠狠色伊人久久精品综合网| 久久国产精品99久久久久久老狼| 亚洲中文字幕久久精品无码APP| 精品久久久久久久国产潘金莲 | 亚洲精品乱码久久久久久自慰| 性高朝久久久久久久久久| 中文字幕精品久久久久人妻| 亚洲AⅤ优女AV综合久久久| 亚洲v国产v天堂a无码久久|