title: Replace HTML attribute using C#
body: <pre><code>&lt;img src="images/img2.jpg"   alt="Cinderella" title="" /&gt;
  </code></pre>
  
  <p>I am getting image -> "src" value &amp; getting the image &amp; converting to Base64 string.
  Apart from this I want to replace value of src(images/img2.jpg) with base64 string value.
  But I am unable find the possible way.</p>
  
  <p>Here is my total code(getting image "src" value &amp; converting to string)</p>
  
  <pre><code>        XmlNodeList names = doc.GetElementsByTagName("img");
          for (uint j = 0; j &lt; names.Length; j++)
          {
              XmlElement ele = (XmlElement)names.Item(j);
              var attri = ele.Attributes;
              var attrilist = attri.ToArray();
              //XmlElement name = names.ElementAt("src");
              for (int i = 0; i &lt; attrilist.Length; i++)
              {
  
                  if (attrilist[i].NodeName == "src")
                  {
                      foreach (var itme in attrilist)
                      {
                          var srcval = attrilist.ToArray();
                          foreach (var srcvl in srcval)
                          {
                              var split = srcvl.NodeValue.ToString().Split('/');
                              StorageFile file = await appfolder.GetFileAsync(split.Last());
                             //converting image
                           }
                        }
  </code></pre>
  
  <p>I am unable to fetch the place of the "src" location in html file</p>
  
  <p>Any help required.</p>