• <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

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            国产激情久久久久久熟女老人 | 国产精品久久久久久久午夜片 | 久久久久这里只有精品| 久久久噜噜噜久久中文字幕色伊伊 | 精品无码久久久久国产动漫3d| 性欧美丰满熟妇XXXX性久久久| 久久久久久免费一区二区三区| 午夜精品久久久内射近拍高清| 久久无码人妻一区二区三区| 国产免费福利体检区久久| 人妻精品久久久久中文字幕69 | 国产精品狼人久久久久影院| 午夜精品久久久久| 岛国搬运www久久| 99精品久久精品一区二区| 国产高清国内精品福利99久久| 久久天天躁狠狠躁夜夜2020一 | 精品久久久久久久| 欧美日韩精品久久久免费观看| 女人香蕉久久**毛片精品| 亚洲AV无码久久精品蜜桃| 人妻无码精品久久亚瑟影视| 久久这里只精品国产99热| 国产午夜精品久久久久免费视| 中文字幕精品久久| 久久无码精品一区二区三区| 91久久精品视频| 久久99国产精品二区不卡| 无码专区久久综合久中文字幕| 四虎国产精品免费久久| 久久成人18免费网站| 狠狠人妻久久久久久综合蜜桃| 久久精品国产精品国产精品污| 久久久亚洲欧洲日产国码aⅴ| 国产偷久久久精品专区| 日产精品99久久久久久| 久久精品夜夜夜夜夜久久| 97久久超碰成人精品网站| 国产日产久久高清欧美一区| 2021精品国产综合久久| 天天久久狠狠色综合|