C# XML文件的读写操作

C# XML文件的读写操作

XML(可扩展标记语言)
定义:用于标记电子文件使其具有结构性的标记语言,可以用来标记数据、定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言。

一、创建xml文件

private void Creat()
        {
            XmlTextWriter writer = new XmlTextWriter("xmlTest.xml", System.Text.Encoding.UTF8);

            //使用自动缩进便于阅读
            writer.Formatting = Formatting.Indented;

            //XML声明
            writer.WriteStartDocument();

            //书写根元素
            writer.WriteStartElement("Root");

            //开始一个元素
            writer.WriteStartElement("Item");

            //向先前创建的元素中添加一个属性
            writer.WriteAttributeString("Id", "1");

            //添加子元素 writer.WriteElementString("title", "表单");
            writer.WriteElementString("Value", "100");
            writer.WriteElementString("Value", "200");

            //关闭item元素
            writer.WriteEndElement(); // 关闭元素

            //在节点间添加一些空
            writer.Close();
        }

执行后生成xmlTest.xml文件,内容如下:

<?xml version="1.0" encoding="utf-8"?>
<Root>
  <Item Id="1">
    <Value>100</Value>
    <Value>200</Value>
  </Item>
</Root>

二、读取节点内容

private void Read()
        {
            // 1.创建一个XmlDocument类的对象
            XmlDocument doc = new XmlDocument();

            // 2.把你想要读取的xml文档加载进来
            doc.Load("xmlTest.xml");

            // 3.读取你指定的节点,注意这是个节点集合类型
            XmlNodeList lis = doc.GetElementsByTagName("Value");

            // 4.取节点中的值
            String str = lis[0].InnerText;

            // 5.显示节点中的值
            MessageBox.Show(str);
        }

三、插入新节点

private void Insert()
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load("xmlTest.xml");
            XmlNode root = xmlDoc.SelectSingleNode("Root");//查找
            XmlElement xe1 = xmlDoc.CreateElement("Title");//创建一个节点</span>
            xe1<span class="token punctuation">.</span><span class="token function">SetAttribute</span><span class="token punctuation">(</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"EasyLife"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设置该节点Name属性</span>
            xe1<span class="token punctuation">.</span><span class="token function">SetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">,</span> <span class="token string">"002"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设置该节点Number属性</span>

            <span class="token class-name">XmlElement</span> xesub1 <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">CreateElement</span><span class="token punctuation">(</span><span class="token string">"Group"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xesub1<span class="token punctuation">.</span>InnerText <span class="token operator">=</span> <span class="token string">"Hello World"</span><span class="token punctuation">;</span><span class="token comment">//设置文本节点</span>
            xe1<span class="token punctuation">.</span><span class="token function">AppendChild</span><span class="token punctuation">(</span>xesub1<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//添加到<book>节点中</span>
            <span class="token class-name">XmlElement</span> xesub2 <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">CreateElement</span><span class="token punctuation">(</span><span class="token string">"Step"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xesub2<span class="token punctuation">.</span>InnerText <span class="token operator">=</span> <span class="token string">"Hello Body"</span><span class="token punctuation">;</span>
            xe1<span class="token punctuation">.</span><span class="token function">AppendChild</span><span class="token punctuation">(</span>xesub2<span class="token punctuation">)</span><span class="token punctuation">;</span>
            
            root<span class="token punctuation">.</span><span class="token function">AppendChild</span><span class="token punctuation">(</span>xe1<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//添加到<Root>节点中</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Save</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
</code></pre> 
  <p>运行结果:</p> 
  <pre><code class="prism language-csharp"><span class="token operator"><</span><span class="token punctuation">?</span><span class="token class-name">xml</span> version<span class="token operator">=</span><span class="token string">"1.0"</span> encoding<span class="token operator">=</span><span class="token string">"utf-8"</span><span class="token punctuation">?</span><span class="token operator">></span>
<span class="token operator"><</span>Root<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Id<span class="token operator">=</span><span class="token string">"1"</span><span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">100</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">200</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Item<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Title</span> Name<span class="token operator">=</span><span class="token string">"EasyLife"</span> Number<span class="token operator">=</span><span class="token string">"002"</span><span class="token operator">></span>
    <span class="token operator"><</span>Group<span class="token operator">></span>Hello World<span class="token operator"><</span><span class="token operator">/</span>Group<span class="token operator">></span>
    <span class="token operator"><</span>Step<span class="token operator">></span>Hello Body<span class="token operator"><</span><span class="token operator">/</span>Step<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Title<span class="token operator">></span>
<span class="token operator"><</span><span class="token operator">/</span>Root<span class="token operator">></span>
</code></pre> 
  <p><strong>四、修改节点或者属性</strong></p> 
  <pre><code class="prism language-csharp"><span class="token keyword">private</span> <span class="token return-type class-name"><span class="token keyword">void</span></span> <span class="token function">Modify</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token class-name">XmlDocument</span> xmlDoc <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token class-name">XmlNodeList</span> nodeList <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">SelectSingleNode</span><span class="token punctuation">(</span><span class="token string">"Root"</span><span class="token punctuation">)</span><span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span><span class="token comment">//获取Root节点的所有子节点</span>
            <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xn <span class="token keyword">in</span> nodeList<span class="token punctuation">)</span><span class="token comment">//遍历所有子节点</span>
            <span class="token punctuation">{</span>
                <span class="token class-name">XmlElement</span> xe <span class="token operator">=</span> <span class="token punctuation">(</span>XmlElement<span class="token punctuation">)</span>xn<span class="token punctuation">;</span><span class="token comment">//将子节点类型转换为XmlElement类型</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token string">"002"</span><span class="token punctuation">)</span><span class="token comment">//如果Number属性值为“002”</span>
                <span class="token punctuation">{</span>
                    xe<span class="token punctuation">.</span><span class="token function">SetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">,</span> <span class="token string">"0021"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//则修改该属性为“0021”</span>

                    <span class="token class-name">XmlNodeList</span> nls <span class="token operator">=</span> xe<span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span><span class="token comment">//继续获取xe子节点的所有子节点</span>
                    <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xn1 <span class="token keyword">in</span> nls<span class="token punctuation">)</span><span class="token comment">//遍历</span>
                    <span class="token punctuation">{</span>
                        <span class="token class-name">XmlElement</span> xe2 <span class="token operator">=</span> <span class="token punctuation">(</span>XmlElement<span class="token punctuation">)</span>xn1<span class="token punctuation">;</span><span class="token comment">//转换类型</span>
                        <span class="token keyword">if</span> <span class="token punctuation">(</span>xe2<span class="token punctuation">.</span>Name <span class="token operator">==</span> <span class="token string">"Group"</span><span class="token punctuation">)</span><span class="token comment">//如果找到</span>
                        <span class="token punctuation">{</span>
                            xe2<span class="token punctuation">.</span>InnerText <span class="token operator">=</span> <span class="token string">"Hello Hello"</span><span class="token punctuation">;</span><span class="token comment">//则修改</span>
                            <span class="token keyword">break</span><span class="token punctuation">;</span><span class="token comment">//找到退出来就可以了</span>
                        <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Save</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//保存。</span>
        <span class="token punctuation">}</span>
</code></pre> 
  <p>运行结果:</p> 
  <pre><code class="prism language-csharp"><span class="token operator"><</span><span class="token punctuation">?</span><span class="token class-name">xml</span> version<span class="token operator">=</span><span class="token string">"1.0"</span> encoding<span class="token operator">=</span><span class="token string">"utf-8"</span><span class="token punctuation">?</span><span class="token operator">></span>
<span class="token operator"><</span>Root<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Id<span class="token operator">=</span><span class="token string">"1"</span><span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">100</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">200</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Item<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Title</span> Name<span class="token operator">=</span><span class="token string">"EasyLife"</span> Number<span class="token operator">=</span><span class="token string">"0021"</span><span class="token operator">></span>
    <span class="token operator"><</span>Group<span class="token operator">></span>Hello Hello<span class="token operator"><</span><span class="token operator">/</span>Group<span class="token operator">></span>
    <span class="token operator"><</span>Step<span class="token operator">></span>Hello Body<span class="token operator"><</span><span class="token operator">/</span>Step<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Title<span class="token operator">></span>
<span class="token operator"><</span><span class="token operator">/</span>Root<span class="token operator">></span>
</code></pre> 
  <p><strong>五、删除节点或者属性</strong></p> 
  <pre><code class="prism language-csharp"><span class="token keyword">private</span> <span class="token return-type class-name"><span class="token keyword">void</span></span> <span class="token function">Delete</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token class-name">XmlDocument</span> xmlDoc <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token class-name">XmlNodeList</span> xnl <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">SelectSingleNode</span><span class="token punctuation">(</span><span class="token string">"Root"</span><span class="token punctuation">)</span><span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span>

            <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xn <span class="token keyword">in</span> xnl<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token class-name">XmlElement</span> xe <span class="token operator">=</span> <span class="token punctuation">(</span>XmlElement<span class="token punctuation">)</span>xn<span class="token punctuation">;</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token string">"002"</span><span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    xe<span class="token punctuation">.</span><span class="token function">RemoveAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//删除Number属性</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token string">"0021"</span><span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    xe<span class="token punctuation">.</span><span class="token function">RemoveAll</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//删除该节点的全部内容</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Save</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
</code></pre> 
  <p>运行结果:</p> 
  <pre><code class="prism language-csharp"><span class="token operator"><</span><span class="token punctuation">?</span><span class="token class-name">xml</span> version<span class="token operator">=</span><span class="token string">"1.0"</span> encoding<span class="token operator">=</span><span class="token string">"utf-8"</span><span class="token punctuation">?</span><span class="token operator">></span>
<span class="token operator"><</span>Root<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Id<span class="token operator">=</span><span class="token string">"1"</span><span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">100</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
    <span class="token operator"><</span>Value<span class="token operator">></span><span class="token number">200</span><span class="token operator"><</span><span class="token operator">/</span>Value<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Item<span class="token operator">></span>
  <span class="token operator"><</span>Title<span class="token operator">></span>
  <span class="token operator"><</span><span class="token operator">/</span>Title<span class="token operator">></span>
<span class="token operator"><</span><span class="token operator">/</span>Root<span class="token operator">></span>
</code></pre> 
  <p><strong>六、显示所有数据</strong></p> 
  <pre><code class="prism language-csharp"><span class="token keyword">private</span> <span class="token return-type class-name"><span class="token keyword">void</span></span> <span class="token function">Display</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token class-name">XmlDocument</span> xmlDoc <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token class-name">XmlNode</span> xn <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">SelectSingleNode</span><span class="token punctuation">(</span><span class="token string">"Root"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token class-name">XmlNodeList</span> xnl <span class="token operator">=</span> xn<span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span>

            <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xnf <span class="token keyword">in</span> xnl<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token class-name">XmlElement</span> xe <span class="token operator">=</span> <span class="token punctuation">(</span>XmlElement<span class="token punctuation">)</span>xnf<span class="token punctuation">;</span>
                Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//显示属性值</span>
                Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Name"</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

                <span class="token class-name">XmlNodeList</span> xnf1 <span class="token operator">=</span> xe<span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span>
                <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xn2 <span class="token keyword">in</span> xnf1<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>xn2<span class="token punctuation">.</span>InnerText<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//显示子节点点文本</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
</code></pre> 
  <p><strong>简单使用示例:</strong><br> 一、创建xml文件</p> 
  <pre><code class="prism language-csharp"><span class="token class-name">XmlTextWriter</span> writer <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlTextWriter</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">,</span> System<span class="token punctuation">.</span>Text<span class="token punctuation">.</span>Encoding<span class="token punctuation">.</span>UTF8<span class="token punctuation">)</span><span class="token punctuation">;</span>
            writer<span class="token punctuation">.</span>Formatting <span class="token operator">=</span> Formatting<span class="token punctuation">.</span>Indented<span class="token punctuation">;</span>
            writer<span class="token punctuation">.</span><span class="token function">WriteStartDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            writer<span class="token punctuation">.</span><span class="token function">WriteStartElement</span><span class="token punctuation">(</span><span class="token string">"Root"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            writer<span class="token punctuation">.</span><span class="token function">WriteEndElement</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            writer<span class="token punctuation">.</span><span class="token function">Close</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> 
  <p>二、每次写入节点数据</p> 
  <pre><code class="prism language-csharp"><span class="token class-name">XmlDocument</span> xmlDoc <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token class-name">XmlNode</span> root <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">SelectSingleNode</span><span class="token punctuation">(</span><span class="token string">"Root"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token class-name">XmlElement</span> xe1 <span class="token operator">=</span> xmlDoc<span class="token punctuation">.</span><span class="token function">CreateElement</span><span class="token punctuation">(</span><span class="token string">"Title"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xe1<span class="token punctuation">.</span><span class="token function">SetAttribute</span><span class="token punctuation">(</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"EasyLife"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            xe1<span class="token punctuation">.</span><span class="token function">SetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">,</span> <span class="token string">"001"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            root<span class="token punctuation">.</span><span class="token function">AppendChild</span><span class="token punctuation">(</span>xe1<span class="token punctuation">)</span><span class="token punctuation">;</span>
            xmlDoc<span class="token punctuation">.</span><span class="token function">Save</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> 
  <p>写入三次数据后的文件</p> 
  <pre><code class="prism language-csharp"><span class="token operator"><</span><span class="token punctuation">?</span><span class="token class-name">xml</span> version<span class="token operator">=</span><span class="token string">"1.0"</span> encoding<span class="token operator">=</span><span class="token string">"utf-8"</span><span class="token punctuation">?</span><span class="token operator">></span>
<span class="token operator"><</span>Root<span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Name<span class="token operator">=</span><span class="token string">"EasyLife"</span> Number<span class="token operator">=</span><span class="token string">"001"</span> <span class="token operator">/</span><span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Name<span class="token operator">=</span><span class="token string">"EasyLife"</span> Number<span class="token operator">=</span><span class="token string">"001"</span> <span class="token operator">/</span><span class="token operator">></span>
  <span class="token operator"><</span><span class="token class-name">Item</span> Name<span class="token operator">=</span><span class="token string">"EasyLife"</span> Number<span class="token operator">=</span><span class="token string">"001"</span> <span class="token operator">/</span><span class="token operator">></span>
<span class="token operator"><</span><span class="token operator">/</span>Root<span class="token operator">></span>
</code></pre> 
  <p>三、读取数据</p> 
  <pre><code class="prism language-csharp"><span class="token class-name">XmlDocument</span> doc <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">XmlDocument</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            doc<span class="token punctuation">.</span><span class="token function">Load</span><span class="token punctuation">(</span><span class="token string">"xmlTest.xml"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token class-name">XmlNodeList</span> nodeList <span class="token operator">=</span> doc<span class="token punctuation">.</span><span class="token function">SelectSingleNode</span><span class="token punctuation">(</span><span class="token string">"List"</span><span class="token punctuation">)</span><span class="token punctuation">.</span>ChildNodes<span class="token punctuation">;</span>
            <span class="token keyword">foreach</span> <span class="token punctuation">(</span><span class="token class-name">XmlNode</span> xn <span class="token keyword">in</span> nodeList<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token class-name">XmlElement</span> xe <span class="token operator">=</span> <span class="token punctuation">(</span>XmlElement<span class="token punctuation">)</span>xn<span class="token punctuation">;</span>
                <span class="token class-name">Item</span> item <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token constructor-invocation class-name">Item</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                item<span class="token punctuation">.</span>Name <span class="token operator">=</span> xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Name"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                item<span class="token punctuation">.</span>Number<span class="token operator">=</span> xe<span class="token punctuation">.</span><span class="token function">GetAttribute</span><span class="token punctuation">(</span><span class="token string">"Number"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
</code></pre> 
 </div> 
</div>
                            </div>
                        </div>
                    </div>
                    <!--PC和WAP自适应版-->
                    <div id="SOHUCS" sid="1687453822550618112"></div>
                    <script type="text/javascript" src="/views/front/js/chanyan.js"></script>
                    <!-- 文章页-底部 动态广告位 -->
                    <div class="youdao-fixed-ad" id="detail_ad_bottom"></div>
                </div>
                <div class="col-md-3">
                    <div class="row" id="ad">
                        <!-- 文章页-右侧1 动态广告位 -->
                        <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_1"> </div>
                        </div>
                        <!-- 文章页-右侧2 动态广告位 -->
                        <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_2"></div>
                        </div>
                        <!-- 文章页-右侧3 动态广告位 -->
                        <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(C#,c#,xml,数据库)</h4>
        <div id="paradigm-article-related">
            <div class="recommend-post mb30">
                <ul class="widget-links">
                    <li><a href="/article/1835508131489214464.htm"
                           title="高级编程--XML+socket练习题" target="_blank">高级编程--XML+socket练习题</a>
                        <span class="text-muted">masa010</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>1.北京华北2114.8万人上海华东2,500万人广州华南1292.68万人成都华西1417万人(1)使用dom4j将信息存入xml中(2)读取信息,并打印控制台(3)添加一个city节点与子节点(4)使用socketTCP协议编写服务端与客户端,客户端输入城市ID,服务器响应相应城市信息(5)使用socketTCP协议编写服务端与客户端,客户端要求用户输入city对象,服务端接收并使用dom4j</div>
                    </li>
                    <li><a href="/article/1835506236842405888.htm"
                           title="C#中使用split分割字符串" target="_blank">C#中使用split分割字符串</a>
                        <span class="text-muted">互联网打工人no1</span>
<a class="tag" taget="_blank" href="/search/c%23/1.htm">c#</a>
                        <div>1、用字符串分隔:usingSystem.Text.RegularExpressions;stringstr="aaajsbbbjsccc";string[]sArray=Regex.Split(str,"js",RegexOptions.IgnoreCase);foreach(stringiinsArray)Response.Write(i.ToString()+"");输出结果:aaabbbc</div>
                    </li>
                    <li><a href="/article/1835504217729626112.htm"
                           title="Python教程:一文了解使用Python处理XPath" target="_blank">Python教程:一文了解使用Python处理XPath</a>
                        <span class="text-muted">旦莫</span>
<a class="tag" taget="_blank" href="/search/Python%E8%BF%9B%E9%98%B6/1.htm">Python进阶</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>目录1.环境准备1.1安装lxml1.2验证安装2.XPath基础2.1什么是XPath?2.2XPath语法2.3示例XML文档3.使用lxml解析XML3.1解析XML文档3.2查看解析结果4.XPath查询4.1基本路径查询4.2使用属性查询4.3查询多个节点5.XPath的高级用法5.1使用逻辑运算符5.2使用函数6.实战案例6.1从网页抓取数据6.1.1安装Requests库6.1.2代</div>
                    </li>
                    <li><a href="/article/1835504218178416640.htm"
                           title="Google earth studio 简介" target="_blank">Google earth studio 简介</a>
                        <span class="text-muted">陟彼高冈yu</span>
<a class="tag" taget="_blank" href="/search/%E6%97%85%E6%B8%B8/1.htm">旅游</a>
                        <div>GoogleEarthStudio是一个基于Web的动画工具,专为创作使用GoogleEarth数据的动画和视频而设计。它利用了GoogleEarth强大的三维地图和卫星影像数据库,使用户能够轻松地创建逼真的地球动画、航拍视频和动态地图可视化。网址为https://www.google.com/earth/studio/。GoogleEarthStudio是一个基于Web的动画工具,专为创作使用G</div>
                    </li>
                    <li><a href="/article/1835501821569888256.htm"
                           title="关于提高复杂业务逻辑代码可读性的思考" target="_blank">关于提高复杂业务逻辑代码可读性的思考</a>
                        <span class="text-muted">编程经验分享</span>
<a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E7%BB%8F%E9%AA%8C/1.htm">开发经验</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>目录前言需求场景常规写法拆分方法领域对象总结前言实际工作中大部分时间都是在写业务逻辑,一般都是三层架构,表示层(Controller)接收客户端请求,并对入参做检验,业务逻辑层(Service)负责处理业务逻辑,一般开发都是在这一层中写具体的业务逻辑。数据访问层(Dao)是直接和数据库交互的,用于查数据给业务逻辑层,或者是将业务逻辑层处理后的数据写入数据库。简单的增删改查接口不用多说,基本上写好一</div>
                    </li>
                    <li><a href="/article/1835499681732456448.htm"
                           title="SQL Server_查询某一数据库中的所有表的内容" target="_blank">SQL Server_查询某一数据库中的所有表的内容</a>
                        <span class="text-muted">qq_42772833</span>
<a class="tag" taget="_blank" href="/search/SQL/1.htm">SQL</a><a class="tag" taget="_blank" href="/search/Server/1.htm">Server</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/sqlserver/1.htm">sqlserver</a>
                        <div>1.查看所有表的表名要列出CrabFarmDB数据库中的所有表(名),可以使用以下SQL语句:USECrabFarmDB;--切换到目标数据库GOSELECTTABLE_NAMEFROMINFORMATION_SCHEMA.TABLESWHERETABLE_TYPE='BASETABLE';对这段SQL脚本的解释:SELECTTABLE_NAME:这个语句的作用是从查询结果中选择TABLE_NAM</div>
                    </li>
                    <li><a href="/article/1835497411179540480.htm"
                           title="深入理解 MultiQueryRetriever:提升向量数据库检索效果的强大工具" target="_blank">深入理解 MultiQueryRetriever:提升向量数据库检索效果的强大工具</a>
                        <span class="text-muted">nseejrukjhad</span>
<a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a>
                        <div>深入理解MultiQueryRetriever:提升向量数据库检索效果的强大工具引言在人工智能和自然语言处理领域,高效准确的信息检索一直是一个关键挑战。传统的基于距离的向量数据库检索方法虽然广泛应用,但仍存在一些局限性。本文将介绍一种创新的解决方案:MultiQueryRetriever,它通过自动生成多个查询视角来增强检索效果,提高结果的相关性和多样性。MultiQueryRetriever的工</div>
                    </li>
                    <li><a href="/article/1835494762388484096.htm"
                           title="【目标检测数据集】卡车数据集1073张VOC+YOLO格式" target="_blank">【目标检测数据集】卡车数据集1073张VOC+YOLO格式</a>
                        <span class="text-muted">熬夜写代码的平头哥∰</span>
<a class="tag" taget="_blank" href="/search/%E7%9B%AE%E6%A0%87%E6%A3%80%E6%B5%8B/1.htm">目标检测</a><a class="tag" taget="_blank" href="/search/YOLO/1.htm">YOLO</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a>
                        <div>数据集格式:PascalVOC格式+YOLO格式(不包含分割路径的txt文件,仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件)图片数量(jpg文件个数):1073标注数量(xml文件个数):1073标注数量(txt文件个数):1073标注类别数:1标注类别名称:["truck"]每个类别标注的框数:truck框数=1120总框数:1120使用标注工具:labelImg标注</div>
                    </li>
                    <li><a href="/article/1835493374514262016.htm"
                           title="MongoDB Oplog 窗口" target="_blank">MongoDB Oplog 窗口</a>
                        <span class="text-muted">喝醉酒的小白</span>
<a class="tag" taget="_blank" href="/search/MongoDB/1.htm">MongoDB</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a>
                        <div>在MongoDB中,oplog(操作日志)是一个特殊的日志系统,用于记录对数据库的所有写操作。oplog允许副本集成员(通常是从节点)应用主节点上已经执行的操作,从而保持数据的一致性。它是MongoDB副本集实现数据复制的基础。MongoDBOplog窗口oplog窗口是指在MongoDB副本集中,从节点可以用来同步数据的时间范围。这个窗口通常由以下因素决定:Oplog大小:oplog的大小是有限</div>
                    </li>
                    <li><a href="/article/1835492742713667584.htm"
                           title="钢筋长度超限检测检数据集VOC+YOLO格式215张1类别" target="_blank">钢筋长度超限检测检数据集VOC+YOLO格式215张1类别</a>
                        <span class="text-muted">futureflsl</span>
<a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E9%9B%86/1.htm">数据集</a><a class="tag" taget="_blank" href="/search/YOLO/1.htm">YOLO</a><a class="tag" taget="_blank" href="/search/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/1.htm">深度学习</a><a class="tag" taget="_blank" href="/search/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/1.htm">机器学习</a>
                        <div>数据集格式:PascalVOC格式+YOLO格式(不包含分割路径的txt文件,仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件)图片数量(jpg文件个数):215标注数量(xml文件个数):215标注数量(txt文件个数):215标注类别数:1标注类别名称:["iron"]每个类别标注的框数:iron框数=215总框数:215使用标注工具:labelImg标注规则:对类别进</div>
                    </li>
                    <li><a href="/article/1835490974911000576.htm"
                           title="python os 环境变量" target="_blank">python os 环境变量</a>
                        <span class="text-muted">CV矿工</span>
<a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/numpy/1.htm">numpy</a>
                        <div>环境变量:环境变量是程序和操作系统之间的通信方式。有些字符不宜明文写进代码里,比如数据库密码,个人账户密码,如果写进自己本机的环境变量里,程序用的时候通过os.environ.get()取出来就行了。os.environ是一个环境变量的字典。环境变量的相关操作importos"""设置/修改环境变量:os.environ[‘环境变量名称’]=‘环境变量值’#其中key和value均为string类</div>
                    </li>
                    <li><a href="/article/1835489460372992000.htm"
                           title="【PG】常见数据库、表属性设置" target="_blank">【PG】常见数据库、表属性设置</a>
                        <span class="text-muted">江无羡</span>
<a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a>
                        <div>PG的常见属性配置方法数据库复制、备份相关表的复制标识单表操作批量表操作链接数据库复制、备份相关表的复制标识单表操作通过ALTER语句单独更改一张表的复制标识。ALTERTABLE[tablename]REPLICAIDENTITYFULL;批量表操作通过代码块的方式,对某个schema中的所有表一起更新其复制标识。SELECTtablename,CASErelreplidentWHEN'd'TH</div>
                    </li>
                    <li><a href="/article/1835483159630802944.htm"
                           title="nosql数据库技术与应用知识点" target="_blank">nosql数据库技术与应用知识点</a>
                        <span class="text-muted">皆过客,揽星河</span>
<a class="tag" taget="_blank" href="/search/NoSQL/1.htm">NoSQL</a><a class="tag" taget="_blank" href="/search/nosql/1.htm">nosql</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/%E9%9D%9E%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">非关系型数据库</a>
                        <div>Nosql知识回顾大数据处理流程数据采集(flume、爬虫、传感器)数据存储(本门课程NoSQL所处的阶段)Hdfs、MongoDB、HBase等数据清洗(入仓)Hive等数据处理、分析(Spark、Flink等)数据可视化数据挖掘、机器学习应用(Python、SparkMLlib等)大数据时代存储的挑战(三高)高并发(同一时间很多人访问)高扩展(要求随时根据需求扩展存储)高效率(要求读写速度快)</div>
                    </li>
                    <li><a href="/article/1835479758033481728.htm"
                           title="SpringBlade dict-biz/list 接口 SQL 注入漏洞" target="_blank">SpringBlade dict-biz/list 接口 SQL 注入漏洞</a>
                        <span class="text-muted">文章永久免费只为良心</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a>
                        <div>SpringBladedict-biz/list接口SQL注入漏洞POC:构造请求包查看返回包你的网址/api/blade-system/dict-biz/list?updatexml(1,concat(0x7e,md5(1),0x7e),1)=1漏洞概述在SpringBlade框架中,如果dict-biz/list接口的后台处理逻辑没有正确地对用户输入进行过滤或参数化查询(PreparedSta</div>
                    </li>
                    <li><a href="/article/1835477614848995328.htm"
                           title="insert into select 主键自增_mybatis拦截器实现主键自动生成" target="_blank">insert into select 主键自增_mybatis拦截器实现主键自动生成</a>
                        <span class="text-muted">weixin_39521651</span>
<a class="tag" taget="_blank" href="/search/insert/1.htm">insert</a><a class="tag" taget="_blank" href="/search/into/1.htm">into</a><a class="tag" taget="_blank" href="/search/select/1.htm">select</a><a class="tag" taget="_blank" href="/search/%E4%B8%BB%E9%94%AE%E8%87%AA%E5%A2%9E/1.htm">主键自增</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/delete%E8%BF%94%E5%9B%9E%E5%80%BC/1.htm">delete返回值</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/insert%E8%BF%94%E5%9B%9E%E4%B8%BB%E9%94%AE/1.htm">insert返回主键</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/insert%E8%BF%94%E5%9B%9E%E5%AF%B9%E8%B1%A1/1.htm">insert返回对象</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/plus/1.htm">plus</a><a class="tag" taget="_blank" href="/search/insert%E8%BF%94%E5%9B%9E%E4%B8%BB%E9%94%AE/1.htm">insert返回主键</a><a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a><a class="tag" taget="_blank" href="/search/plus/1.htm">plus</a><a class="tag" taget="_blank" href="/search/%E6%8F%92%E5%85%A5%E7%94%9F%E6%88%90id/1.htm">插入生成id</a>
                        <div>前言前阵子和朋友聊天,他说他们项目有个需求,要实现主键自动生成,不想每次新增的时候,都手动设置主键。于是我就问他,那你们数据库表设置主键自动递增不就得了。他的回答是他们项目目前的id都是采用雪花算法来生成,因此为了项目稳定性,不会切换id的生成方式。朋友问我有没有什么实现思路,他们公司的orm框架是mybatis,我就建议他说,不然让你老大把mybatis切换成mybatis-plus。mybat</div>
                    </li>
                    <li><a href="/article/1835471689929027584.htm"
                           title="关于Mysql 中 Row size too large (> 8126) 错误的解决和理解" target="_blank">关于Mysql 中 Row size too large (> 8126) 错误的解决和理解</a>
                        <span class="text-muted">秋刀prince</span>
<a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a>
                        <div>提示:啰嗦一嘴,数据库的任何操作和验证前,一定要记得先备份!!!不会有错;文章目录问题发现一、问题导致的可能原因1、页大小2、行格式2.1compact格式2.2Redundant格式2.3Dynamic格式2.4Compressed格式3、BLOB和TEXT列二、解决办法1、修改页大小(不推荐)2、修改行格式3、修改数据类型为BLOB和TEXT列4、其他优化方式(可以参考使用)4.1合理设置数据</div>
                    </li>
                    <li><a href="/article/1835471059135066112.htm"
                           title="你可能遗漏的一些C#/.NET/.NET Core知识点" target="_blank">你可能遗漏的一些C#/.NET/.NET Core知识点</a>
                        <span class="text-muted">追逐时光者</span>
<a class="tag" taget="_blank" href="/search/C%23/1.htm">C#</a><a class="tag" taget="_blank" href="/search/.NET/1.htm">.NET</a><a class="tag" taget="_blank" href="/search/DotNetGuide%E7%BC%96%E7%A8%8B%E6%8C%87%E5%8D%97/1.htm">DotNetGuide编程指南</a><a class="tag" taget="_blank" href="/search/c%23/1.htm">c#</a><a class="tag" taget="_blank" href="/search/.net/1.htm">.net</a><a class="tag" taget="_blank" href="/search/.netcore/1.htm">.netcore</a><a class="tag" taget="_blank" href="/search/microsoft/1.htm">microsoft</a>
                        <div>前言在这个快速发展的技术世界中,时常会有一些重要的知识点、信息或细节被忽略或遗漏。《C#/.NET/.NETCore拾遗补漏》专栏我们将探讨一些可能被忽略或遗漏的重要知识点、信息或细节,以帮助大家更全面地了解这些技术栈的特性和发展方向。拾遗补漏GitHub开源地址https://github.com/YSGStudyHards/DotNetGuide/blob/main/docs/DotNet/D</div>
                    </li>
                    <li><a href="/article/1835458199755517952.htm"
                           title="spring如何整合druid连接池?" target="_blank">spring如何整合druid连接池?</a>
                        <span class="text-muted">惜.己</span>
<a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/junit/1.htm">junit</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/idea/1.htm">idea</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a><a class="tag" taget="_blank" href="/search/xml/1.htm">xml</a>
                        <div>目录spring整合druid连接池1.新建maven项目2.新建mavenModule3.导入相关依赖4.配置log4j2.xml5.配置druid.xml1)xml中如何引入properties2)下面是配置文件6.准备jdbc.propertiesJDBC配置项解释7.配置druid8.测试spring整合druid连接池1.新建maven项目打开IDE(比如IntelliJIDEA,Ecl</div>
                    </li>
                    <li><a href="/article/1835454921990828032.htm"
                           title="Java爬虫框架(一)--架构设计" target="_blank">Java爬虫框架(一)--架构设计</a>
                        <span class="text-muted">狼图腾-狼之传说</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%A1%86%E6%9E%B6/1.htm">框架</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E4%BB%BB%E5%8A%A1/1.htm">任务</a><a class="tag" taget="_blank" href="/search/html%E8%A7%A3%E6%9E%90%E5%99%A8/1.htm">html解析器</a><a class="tag" taget="_blank" href="/search/%E5%AD%98%E5%82%A8/1.htm">存储</a><a class="tag" taget="_blank" href="/search/%E7%94%B5%E5%AD%90%E5%95%86%E5%8A%A1/1.htm">电子商务</a>
                        <div>一、架构图那里搜网络爬虫框架主要针对电子商务网站进行数据爬取,分析,存储,索引。爬虫:爬虫负责爬取,解析,处理电子商务网站的网页的内容数据库:存储商品信息索引:商品的全文搜索索引Task队列:需要爬取的网页列表Visited表:已经爬取过的网页列表爬虫监控平台:web平台可以启动,停止爬虫,管理爬虫,task队列,visited表。二、爬虫1.流程1)Scheduler启动爬虫器,TaskMast</div>
                    </li>
                    <li><a href="/article/1835451016456269824.htm"
                           title="MongoDB知识概括" target="_blank">MongoDB知识概括</a>
                        <span class="text-muted">GeorgeLin98</span>
<a class="tag" taget="_blank" href="/search/%E6%8C%81%E4%B9%85%E5%B1%82/1.htm">持久层</a><a class="tag" taget="_blank" href="/search/mongodb/1.htm">mongodb</a>
                        <div>MongoDB知识概括MongoDB相关概念单机部署基本常用命令索引-IndexSpirngDataMongoDB集成副本集分片集群安全认证MongoDB相关概念业务应用场景:传统的关系型数据库(如MySQL),在数据操作的“三高”需求以及应对Web2.0的网站需求面前,显得力不从心。解释:“三高”需求:①Highperformance-对数据库高并发读写的需求。②HugeStorage-对海量数</div>
                    </li>
                    <li><a href="/article/1835447985601867776.htm"
                           title="Mongodb Error: queryTxt ETIMEOUT xxxx.wwwdz.mongodb.net" target="_blank">Mongodb Error: queryTxt ETIMEOUT xxxx.wwwdz.mongodb.net</a>
                        <span class="text-muted">佛一脚</span>
<a class="tag" taget="_blank" href="/search/error/1.htm">error</a><a class="tag" taget="_blank" href="/search/react/1.htm">react</a><a class="tag" taget="_blank" href="/search/mongodb/1.htm">mongodb</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a>
                        <div>背景每天都能遇到奇怪的问题,做个记录,以便有缘人能得到帮助!换了一台电脑开发nextjs程序。需要连接mongodb数据,对数据进行增删改查。上一台电脑好好的程序,新电脑死活连不上mongodb数据库。同一套代码,没任何修改,搞得我怀疑人生了,打开浏览器进入mongodb官网毫无问题,也能进入线上系统查看数据,网络应该是没问题。于是我尝试了一下手机热点,这次代码能正常跑起来,连接数据库了!!!是不</div>
                    </li>
                    <li><a href="/article/1835443822654484480.htm"
                           title="遥感影像的切片处理" target="_blank">遥感影像的切片处理</a>
                        <span class="text-muted">sand&wich</span>
<a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/1.htm">计算机视觉</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%9B%BE%E5%83%8F%E5%A4%84%E7%90%86/1.htm">图像处理</a>
                        <div>在遥感影像分析中,经常需要将大尺寸的影像切分成小片段,以便于进行详细的分析和处理。这种方法特别适用于机器学习和图像处理任务,如对象检测、图像分类等。以下是如何使用Python和OpenCV库来实现这一过程,同时确保每个影像片段保留正确的地理信息。准备环境首先,确保安装了必要的Python库,包括numpy、opencv-python和xml.etree.ElementTree。这些库将用于图像处理</div>
                    </li>
                    <li><a href="/article/1835443013749403648.htm"
                           title="入门MySQL——查询语法练习" target="_blank">入门MySQL——查询语法练习</a>
                        <span class="text-muted">K_un</span>

                        <div>前言:前面几篇文章为大家介绍了DML以及DDL语句的使用方法,本篇文章将主要讲述常用的查询语法。其实MySQL官网给出了多个示例数据库供大家实用查询,下面我们以最常用的员工示例数据库为准,详细介绍各自常用的查询语法。1.员工示例数据库导入官方文档员工示例数据库介绍及下载链接:https://dev.mysql.com/doc/employee/en/employees-installation.h</div>
                    </li>
                    <li><a href="/article/1835437775344726016.htm"
                           title="博客网站制作教程" target="_blank">博客网站制作教程</a>
                        <span class="text-muted">2401_85194651</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/maven/1.htm">maven</a>
                        <div>首先就是技术框架:后端:Java+SpringBoot数据库:MySQL前端:Vue.js数据库连接:JPA(JavaPersistenceAPI)1.项目结构blog-app/├──backend/│├──src/main/java/com/example/blogapp/││├──BlogApplication.java││├──config/│││└──DatabaseConfig.java</div>
                    </li>
                    <li><a href="/article/1835434126874865664.htm"
                           title="ubuntu安装wordpress" target="_blank">ubuntu安装wordpress</a>
                        <span class="text-muted">lissettecarlr</span>

                        <div>1安装nginx网上安装方式很多,这就就直接用apt-get了apt-getinstallnginx不用启动啥,然后直接在浏览器里面输入IP:80就能看到nginx的主页了。如果修改了一些配置可以使用下列命令重启一下systemctlrestartnginx.service2安装mysql输入安装前也可以更新一下软件源,在安装过程中将会让你输入数据库的密码。sudoapt-getinstallmy</div>
                    </li>
                    <li><a href="/article/1835432358141063168.htm"
                           title="深入浅出 -- 系统架构之负载均衡Nginx的性能优化" target="_blank">深入浅出 -- 系统架构之负载均衡Nginx的性能优化</a>
                        <span class="text-muted">xiaoli8748_软件开发</span>
<a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84/1.htm">系统架构</a><a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84/1.htm">系统架构</a><a class="tag" taget="_blank" href="/search/%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/1.htm">负载均衡</a><a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a>
                        <div>一、Nginx性能优化到这里文章的篇幅较长了,最后再来聊一下关于Nginx的性能优化,主要就简单说说收益最高的几个优化项,在这块就不再展开叙述了,毕竟影响性能都有多方面原因导致的,比如网络、服务器硬件、操作系统、后端服务、程序自身、数据库服务等,对于性能调优比较感兴趣的可以参考之前《JVM性能调优》中的调优思想。优化一:打开长连接配置通常Nginx作为代理服务,负责分发客户端的请求,那么建议开启H</div>
                    </li>
                    <li><a href="/article/1835432106029838336.htm"
                           title="【RabbitMQ 项目】服务端:数据管理模块之绑定管理" target="_blank">【RabbitMQ 项目】服务端:数据管理模块之绑定管理</a>
                        <span class="text-muted">月夜星辉雪</span>
<a class="tag" taget="_blank" href="/search/rabbitmq/1.htm">rabbitmq</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a>
                        <div>文章目录一.编写思路二.代码实践一.编写思路定义绑定信息类交换机名称队列名称绑定关键字:交换机的路由交换算法中会用到没有是否持久化的标志,因为绑定是否持久化取决于交换机和队列是否持久化,只有它们都持久化时绑定才需要持久化。绑定就好像一根绳子,两端连接着交换机和队列,当一方不存在,它就没有存在的必要了定义绑定持久化类构造函数:如果数据库文件不存在则创建,打开数据库,创建binding_table插入</div>
                    </li>
                    <li><a href="/article/1835428821877223424.htm"
                           title="计算机毕业设计PHP仓储综合管理系统(源码+程序+VUE+lw+部署)" target="_blank">计算机毕业设计PHP仓储综合管理系统(源码+程序+VUE+lw+部署)</a>
                        <span class="text-muted">java毕设程序源码王哥</span>
<a class="tag" taget="_blank" href="/search/php/1.htm">php</a><a class="tag" taget="_blank" href="/search/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/1.htm">课程设计</a><a class="tag" taget="_blank" href="/search/vue.js/1.htm">vue.js</a>
                        <div>该项目含有源码、文档、程序、数据库、配套开发软件、软件安装教程。欢迎交流项目运行环境配置:phpStudy+Vscode+Mysql5.7+HBuilderX+Navicat11+Vue+Express。项目技术:原生PHP++Vue等等组成,B/S模式+Vscode管理+前后端分离等等。环境需要1.运行环境:最好是小皮phpstudy最新版,我们在这个版本上开发的。其他版本理论上也可以。2.开发</div>
                    </li>
                    <li><a href="/article/1835420248896008192.htm"
                           title="使用由 Python 编写的 lxml 实现高性能 XML 解析" target="_blank">使用由 Python 编写的 lxml 实现高性能 XML 解析</a>
                        <span class="text-muted">hunyxv</span>
<a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/xml/1.htm">xml</a>
                        <div>转载自:文章lxml简介Python从来不出现XML库短缺的情况。从2.0版本开始,它就附带了xml.dom.minidom和相关的pulldom以及SimpleAPIforXML(SAX)模块。从2.4开始,它附带了流行的ElementTreeAPI。此外,很多第三方库可以提供更高级别的或更具有python风格的接口。尽管任何XML库都足够处理简单的DocumentObjectModel(DOM</div>
                    </li>
                    <li><a href="/article/1835403761783238656.htm"
                           title="3.增删改查--连接查询" target="_blank">3.增删改查--连接查询</a>
                        <span class="text-muted">问女何所忆</span>

                        <div>关系型数据库的一个特点就是,多张表之间存在关系,以致于我们可以连接多张表进行查询操作,所以连接查询会是关系型数据库中最常见的操作。连接查询主要分为三种,交叉连接、内连接和外连接,我们一个个说。1、交叉连接交叉连接其实连接查询的第一个阶段,它简单表现为两张表的笛卡尔积形式,具体例子:如果你没学过数学中的笛卡尔积概念,你可以这样简单的理解这里的交叉连接:两张表的交叉连接就是一个连接合并的过程,T1表中</div>
                    </li>
                                <li><a href="/article/88.htm"
                                       title="ztree设置禁用节点" target="_blank">ztree设置禁用节点</a>
                                    <span class="text-muted">3213213333332132</span>
<a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a><a class="tag" taget="_blank" href="/search/ztree/1.htm">ztree</a><a class="tag" taget="_blank" href="/search/json/1.htm">json</a><a class="tag" taget="_blank" href="/search/setDisabledNode/1.htm">setDisabledNode</a><a class="tag" taget="_blank" href="/search/Ajax/1.htm">Ajax</a>
                                    <div>ztree设置禁用节点的时候注意,当使用ajax后台请求数据,必须要设置为同步获取数据,否者会获取不到节点对象,导致设置禁用没有效果。 
 
 
$(function(){            	
                showTree();
	            setDisabledNode();

});
                   
        </div>
                                </li>
                                <li><a href="/article/215.htm"
                                       title="JVM patch by Taobao" target="_blank">JVM patch by Taobao</a>
                                    <span class="text-muted">bookjovi</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/HotSpot/1.htm">HotSpot</a>
                                    <div>在网上无意中看到淘宝提交的hotspot patch,共四个,有意思,记录一下。 
  
7050685:jsdbproc64.sh has a typo in the package name 
7058036:FieldsAllocationStyle=2 does not work in 32-bit VM 
7060619:C1 should respect inline and</div>
                                </li>
                                <li><a href="/article/342.htm"
                                       title="将session存储到数据库中" target="_blank">将session存储到数据库中</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/PHP/1.htm">PHP</a><a class="tag" taget="_blank" href="/search/session/1.htm">session</a>
                                    <div>CREATE TABLE sessions (
  id CHAR(32) NOT NULL,
  data TEXT,
  last_accessed TIMESTAMP NOT NULL,
  PRIMARY KEY (id)
); 
  
<?php
/**
 * Created by PhpStorm.
 * User: michaeldu
 * Date</div>
                                </li>
                                <li><a href="/article/469.htm"
                                       title="Vector" target="_blank">Vector</a>
                                    <span class="text-muted">171815164</span>
<a class="tag" taget="_blank" href="/search/vector/1.htm">vector</a>
                                    <div>public Vector<CartProduct> delCart(Vector<CartProduct> cart, String id) {
		for (int i = 0; i < cart.size(); i++) {
			if (cart.get(i).getId().equals(id)) {
				cart.remove(i);
				</div>
                                </li>
                                <li><a href="/article/596.htm"
                                       title="各连接池配置参数比较" target="_blank">各连接池配置参数比较</a>
                                    <span class="text-muted">g21121</span>
<a class="tag" taget="_blank" href="/search/%E8%BF%9E%E6%8E%A5%E6%B1%A0/1.htm">连接池</a>
                                    <div>        排版真心费劲,大家凑合看下吧,见谅~ 
      
  
Druid 
DBCP 
C3P0 
Proxool   
数据库用户名称 Username Username User     
数据库密码 Password Password Password     
驱动名</div>
                                </li>
                                <li><a href="/article/723.htm"
                                       title="[简单]mybatis insert语句添加动态字段" target="_blank">[简单]mybatis insert语句添加动态字段</a>
                                    <span class="text-muted">53873039oycg</span>
<a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a>
                                    <div>      mysql数据库,id自增,配置如下: 
      
<insert id="saveTestTb" useGeneratedKeys="true" keyProperty="id"
		parameterType=&</div>
                                </li>
                                <li><a href="/article/850.htm"
                                       title="struts2拦截器配置" target="_blank">struts2拦截器配置</a>
                                    <span class="text-muted">云端月影</span>
<a class="tag" taget="_blank" href="/search/struts2%E6%8B%A6%E6%88%AA%E5%99%A8/1.htm">struts2拦截器</a>
                                    <div>struts2拦截器interceptor的三种配置方法 
方法1. 普通配置法 
 
<struts> 
    <package name="struts2" extends="struts-default"> 
        &</div>
                                </li>
                                <li><a href="/article/977.htm"
                                       title="IE中页面不居中,火狐谷歌等正常" target="_blank">IE中页面不居中,火狐谷歌等正常</a>
                                    <span class="text-muted">aijuans</span>
<a class="tag" taget="_blank" href="/search/IE%E4%B8%AD%E9%A1%B5%E9%9D%A2%E4%B8%8D%E5%B1%85%E4%B8%AD/1.htm">IE中页面不居中</a>
                                    <div>问题是首页在火狐、谷歌、所有IE中正常显示,列表页的页面在火狐谷歌中正常,在IE6、7、8中都不中,觉得可能那个地方设置的让IE系列都不认识,仔细查看后发现,列表页中没写HTML模板部分没有添加DTD定义,就是<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3</div>
                                </li>
                                <li><a href="/article/1104.htm"
                                       title="String,int,Integer,char 几个类型常见转换" target="_blank">String,int,Integer,char 几个类型常见转换</a>
                                    <span class="text-muted">antonyup_2006</span>
<a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/.net/1.htm">.net</a>
                                    <div>如何将字串 String 转换成整数 int? 
int i = Integer.valueOf(my_str).intValue(); 
 
int i=Integer.parseInt(str); 
 
如何将字串 String 转换成Integer ? 
Integer integer=Integer.valueOf(str); 
 
如何将整数 int 转换成字串 String ? 
1.</div>
                                </li>
                                <li><a href="/article/1231.htm"
                                       title="PL/SQL的游标类型" target="_blank">PL/SQL的游标类型</a>
                                    <span class="text-muted">百合不是茶</span>
<a class="tag" taget="_blank" href="/search/%E6%98%BE%E7%A4%BA%E6%B8%B8%E6%A0%87%28%E9%9D%99%E6%80%81%E6%B8%B8%E6%A0%87%29/1.htm">显示游标(静态游标)</a><a class="tag" taget="_blank" href="/search/%E9%9A%90%E5%BC%8F%E6%B8%B8%E6%A0%87/1.htm">隐式游标</a><a class="tag" taget="_blank" href="/search/%E6%B8%B8%E6%A0%87%E7%9A%84%E6%9B%B4%E6%96%B0%E5%92%8C%E5%88%A0%E9%99%A4/1.htm">游标的更新和删除</a><a class="tag" taget="_blank" href="/search/%25rowtype/1.htm">%rowtype</a><a class="tag" taget="_blank" href="/search/ref%E6%B8%B8%E6%A0%87%28%E5%8A%A8%E6%80%81%E6%B8%B8%E6%A0%87%29/1.htm">ref游标(动态游标)</a>
                                    <div>游标是oracle中的一个结果集,用于存放查询的结果; 
  
PL/SQL中游标的声明; 
1,声明游标

2,打开游标(默认是关闭的);

3,提取数据

4,关闭游标
 
  
  
注意的要点:游标必须声明在declare中,使用open打开游标,fetch取游标中的数据,close关闭游标 
  
隐式游标:主要是对DML数据的操作隐</div>
                                </li>
                                <li><a href="/article/1358.htm"
                                       title="JUnit4中@AfterClass @BeforeClass @after @before的区别对比" target="_blank">JUnit4中@AfterClass @BeforeClass @after @before的区别对比</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/JUnit4/1.htm">JUnit4</a><a class="tag" taget="_blank" href="/search/%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95/1.htm">单元测试</a>
                                    <div>一.基础知识 
JUnit4使用Java5中的注解(annotation),以下是JUnit4常用的几个annotation: @Before:初始化方法   对于每一个测试方法都要执行一次(注意与BeforeClass区别,后者是对于所有方法执行一次)@After:释放资源  对于每一个测试方法都要执行一次(注意与AfterClass区别,后者是对于所有方法执行一次</div>
                                </li>
                                <li><a href="/article/1485.htm"
                                       title="精通Oracle10编程SQL(12)开发包" target="_blank">精通Oracle10编程SQL(12)开发包</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/plsql/1.htm">plsql</a>
                                    <div>/*
 *开发包
 *包用于逻辑组合相关的PL/SQL类型(例如TABLE类型和RECORD类型)、PL/SQL项(例如游标和游标变量)和PL/SQL子程序(例如过程和函数)
 */
--包用于逻辑组合相关的PL/SQL类型、项和子程序,它由包规范和包体两部分组成
--建立包规范:包规范实际是包与应用程序之间的接口,它用于定义包的公用组件,包括常量、变量、游标、过程和函数等
--在包规</div>
                                </li>
                                <li><a href="/article/1612.htm"
                                       title="【EhCache二】ehcache.xml配置详解" target="_blank">【EhCache二】ehcache.xml配置详解</a>
                                    <span class="text-muted">bit1129</span>
<a class="tag" taget="_blank" href="/search/ehcache.xml/1.htm">ehcache.xml</a>
                                    <div>在ehcache官网上找了多次,终于找到ehcache.xml配置元素和属性的含义说明文档了,这个文档包含在ehcache.xml的注释中! 
ehcache.xml : http://ehcache.org/ehcache.xml 
ehcache.xsd : http://ehcache.org/ehcache.xsd 
ehcache配置文件的根元素是ehcahe 
  ehcac</div>
                                </li>
                                <li><a href="/article/1739.htm"
                                       title="java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL" target="_blank">java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL</a>
                                    <span class="text-muted">白糖_</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/eclipse/1.htm">eclipse</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/tomcat/1.htm">tomcat</a><a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a>
                                    <div>今天学习spring+cxf的时候遇到一个问题:在web.xml中配置了spring的上下文监听器: 
<listener>
	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> 
 随后启动</div>
                                </li>
                                <li><a href="/article/1866.htm"
                                       title="angular.element" target="_blank">angular.element</a>
                                    <span class="text-muted">boyitech</span>
<a class="tag" taget="_blank" href="/search/AngularJS/1.htm">AngularJS</a><a class="tag" taget="_blank" href="/search/AngularJS+API/1.htm">AngularJS API</a><a class="tag" taget="_blank" href="/search/angular.element/1.htm">angular.element</a>
                                    <div>angular.element 
描述:      包裹着一部分DOM element或者是HTML字符串,把它作为一个jQuery元素来处理。(类似于jQuery的选择器啦)       如果jQuery被引入了,则angular.element就可以看作是jQuery选择器,选择的对象可以使用jQuery的函数;如果jQuery不可用,angular.e</div>
                                </li>
                                <li><a href="/article/1993.htm"
                                       title="java-给定两个已排序序列,找出共同的元素。" target="_blank">java-给定两个已排序序列,找出共同的元素。</a>
                                    <span class="text-muted">bylijinnan</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                                    <div>
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class CommonItemInTwoSortedArray {

	/**
	 * 题目:给定两个已排序序列,找出共同的元素。
	 * 1.定义两个指针分别指向序列的开始。
	 * 如果指向的两个元素</div>
                                </li>
                                <li><a href="/article/2120.htm"
                                       title="sftp 异常,有遇到的吗?求解" target="_blank">sftp 异常,有遇到的吗?求解</a>
                                    <span class="text-muted">Chen.H</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/jcraft/1.htm">jcraft</a><a class="tag" taget="_blank" href="/search/auth/1.htm">auth</a><a class="tag" taget="_blank" href="/search/jsch/1.htm">jsch</a><a class="tag" taget="_blank" href="/search/jschexception/1.htm">jschexception</a>
                                    <div>com.jcraft.jsch.JSchException: Auth cancel 
 at com.jcraft.jsch.Session.connect(Session.java:460) 
 at com.jcraft.jsch.Session.connect(Session.java:154) 
 at cn.vivame.util.ftp.SftpServerAccess.connec</div>
                                </li>
                                <li><a href="/article/2247.htm"
                                       title="[生物智能与人工智能]神经元中的电化学结构代表什么?" target="_blank">[生物智能与人工智能]神经元中的电化学结构代表什么?</a>
                                    <span class="text-muted">comsci</span>
<a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a>
                                    <div>     我这里做一个大胆的猜想,生物神经网络中的神经元中包含着一些化学和类似电路的结构,这些结构通常用来扮演类似我们在拓扑分析系统中的节点嵌入方程一样,使得我们的神经网络产生智能判断的能力,而这些嵌入到节点中的方程同时也扮演着"经验"的角色.... 
 
     我们可以尝试一下...在某些神经</div>
                                </li>
                                <li><a href="/article/2374.htm"
                                       title="通过LAC和CID获取经纬度信息" target="_blank">通过LAC和CID获取经纬度信息</a>
                                    <span class="text-muted">dai_lm</span>
<a class="tag" taget="_blank" href="/search/lac/1.htm">lac</a><a class="tag" taget="_blank" href="/search/cid/1.htm">cid</a>
                                    <div>方法1: 
用浏览器打开http://www.minigps.net/cellsearch.html,然后输入lac和cid信息(mcc和mnc可以填0),如果数据正确就可以获得相应的经纬度 
 
方法2: 
发送HTTP请求到http://www.open-electronics.org/celltrack/cell.php?hex=0&lac=<lac>&cid=&</div>
                                </li>
                                <li><a href="/article/2501.htm"
                                       title="JAVA的困难分析" target="_blank">JAVA的困难分析</a>
                                    <span class="text-muted">datamachine</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                                    <div>前段时间转了一篇SQL的文章(http://datamachine.iteye.com/blog/1971896),文章不复杂,但思想深刻,就顺便思考了一下java的不足,当砖头丢出来,希望引点和田玉。 
  
-----------------------------------------------------------------------------------------</div>
                                </li>
                                <li><a href="/article/2628.htm"
                                       title="小学5年级英语单词背诵第二课" target="_blank">小学5年级英语单词背诵第二课</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/english/1.htm">english</a><a class="tag" taget="_blank" href="/search/word/1.htm">word</a>
                                    <div>money 钱 
paper 纸 
speak 讲,说 
tell 告诉 
  
remember 记得,想起 
knock 敲,击,打 
question 问题 
number 数字,号码 
  
learn 学会,学习 
street 街道 
carry 搬运,携带 
send 发送,邮寄,发射 
  
must 必须 
light 灯,光线,轻的 
front </div>
                                </li>
                                <li><a href="/article/2755.htm"
                                       title="linux下面没有tree命令" target="_blank">linux下面没有tree命令</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                                    <div>centos p安装 
yum -y install tree 
  
mac os安装 
brew install tree 
  首先来看tree的用法  
tree  中文解释:tree
功能说明:以树状图列出目录的内容。
语  法:tree [-aACdDfFgilnNpqstux][-I <范本样式>][-P <范本样式</div>
                                </li>
                                <li><a href="/article/2882.htm"
                                       title="Map迭代方式,Map迭代,Map循环" target="_blank">Map迭代方式,Map迭代,Map循环</a>
                                    <span class="text-muted">蕃薯耀</span>
<a class="tag" taget="_blank" href="/search/Map%E5%BE%AA%E7%8E%AF/1.htm">Map循环</a><a class="tag" taget="_blank" href="/search/Map%E8%BF%AD%E4%BB%A3/1.htm">Map迭代</a><a class="tag" taget="_blank" href="/search/Map%E8%BF%AD%E4%BB%A3%E6%96%B9%E5%BC%8F/1.htm">Map迭代方式</a>
                                    <div>Map迭代方式,Map迭代,Map循环 
  
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
蕃薯耀 2015年</div>
                                </li>
                                <li><a href="/article/3009.htm"
                                       title="Spring Cache注解+Redis" target="_blank">Spring Cache注解+Redis</a>
                                    <span class="text-muted">hanqunfeng</span>
<a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a>
                                    <div>Spring3.1 Cache注解  
依赖jar包: 
<!-- redis -->
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-redis</artifactId>
			</div>
                                </li>
                                <li><a href="/article/3136.htm"
                                       title="Guava中针对集合的 filter和过滤功能" target="_blank">Guava中针对集合的 filter和过滤功能</a>
                                    <span class="text-muted">jackyrong</span>
<a class="tag" taget="_blank" href="/search/filter/1.htm">filter</a>
                                    <div>在guava库中,自带了过滤器(filter)的功能,可以用来对collection 进行过滤,先看例子: 
 
   

@Test
public void whenFilterWithIterables_thenFiltered() {
    List<String> names = Lists.newArrayList("John"</div>
                                </li>
                                <li><a href="/article/3263.htm"
                                       title="学习编程那点事" target="_blank">学习编程那点事</a>
                                    <span class="text-muted">lampcy</span>
<a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B/1.htm">编程</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/PHP/1.htm">PHP</a><a class="tag" taget="_blank" href="/search/html5/1.htm">html5</a>
                                    <div>一年前的夏天,我还在纠结要不要改行,要不要去学php?能学到真本事吗?改行能成功吗?太多的问题,我终于不顾一切,下定决心,辞去了工作,来到传说中的帝都。老师给的乘车方式还算有效,很顺利的就到了学校,赶巧了,正好学校搬到了新校区。先安顿了下来,过了个轻松的周末,第一次到帝都,逛逛吧! 
接下来的周一,是我噩梦的开始,学习内容对我这个零基础的人来说,除了勉强完成老师布置的作业外,我已经没有时间和精力去</div>
                                </li>
                                <li><a href="/article/3390.htm"
                                       title="架构师之流处理---------bytebuffer的mark,limit和flip" target="_blank">架构师之流处理---------bytebuffer的mark,limit和flip</a>
                                    <span class="text-muted">nannan408</span>
<a class="tag" taget="_blank" href="/search/ByteBuffer/1.htm">ByteBuffer</a>
                                    <div>1.前言。 
  如题,limit其实就是可以读取的字节长度的意思,flip是清空的意思,mark是标记的意思 。 
2.例子. 
 

例子代码:
     String str = "helloWorld";  
        ByteBuffer buff  = ByteBuffer.wrap(str.getBytes());  
        Sy</div>
                                </li>
                                <li><a href="/article/3517.htm"
                                       title="org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1" target="_blank">org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1</a>
                                    <span class="text-muted">Everyday都不同</span>
<a class="tag" taget="_blank" href="/search/%24/1.htm">$</a><a class="tag" taget="_blank" href="/search/%E8%BD%AC%E4%B9%89/1.htm">转义</a><a class="tag" taget="_blank" href="/search/el%E8%A1%A8%E8%BE%BE%E5%BC%8F/1.htm">el表达式</a>
                                    <div>最近在做Highcharts的过程中,在写js时,出现了以下异常: 
  
严重: Servlet.service() for servlet jsp threw exception 
org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, </div>
                                </li>
                                <li><a href="/article/3644.htm"
                                       title="用Java实现发送邮件到163" target="_blank">用Java实现发送邮件到163</a>
                                    <span class="text-muted">tntxia</span>
<a class="tag" taget="_blank" href="/search/java%E5%AE%9E%E7%8E%B0/1.htm">java实现</a>
                                    <div>/*

 在java版经常看到有人问如何用javamail发送邮件?如何接收邮件?如何访问多个文件夹等。问题零散,而历史的回复早已经淹没在问题的海洋之中。

 本人之前所做过一个java项目,其中包含有WebMail功能,当初为用java实现而对javamail摸索了一段时间,总算有点收获。看到论坛中的经常有此方面的问题,因此把我的一些经验帖出来,希望对大家有些帮助。

 此篇仅介绍用</div>
                                </li>
                                <li><a href="/article/3771.htm"
                                       title="探索实体类存在的真正意义" target="_blank">探索实体类存在的真正意义</a>
                                    <span class="text-muted">java小叶檀</span>
<a class="tag" taget="_blank" href="/search/POJO/1.htm">POJO</a>
                                    <div>一. 实体类简述   
 实体类其实就是俗称的POJO,这种类一般不实现特殊框架下的接口,在程序中仅作为数据容器用来持久化存储数据用的 
POJO(Plain Old Java Objects)简单的Java对象 
  
它的一般格式就是 
public class A{
      private String id;
      public Str</div>
                                </li>
                </ul>
            </div>
        </div>
    </div>

<div>
    <div class="container">
        <div class="indexes">
            <strong>按字母分类:</strong>
            <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a
                href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a
                href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a
                href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a
                href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a
                href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a
                href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a
                href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a
                href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a>
        </div>
    </div>
</div>
<footer id="footer" class="mb30 mt30">
    <div class="container">
        <div class="footBglm">
            <a target="_blank" href="/">首页</a> -
            <a target="_blank" href="/custom/about.htm">关于我们</a> -
            <a target="_blank" href="/search/Java/1.htm">站内搜索</a> -
            <a target="_blank" href="/sitemap.txt">Sitemap</a> -
            <a target="_blank" href="/custom/delete.htm">侵权投诉</a>
        </div>
        <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved.
<!--            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>-->
        </div>
    </div>
</footer>
<!-- 代码高亮 -->
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/>
<script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script>





</body>

</html>