Guest User

Untitled

a guest
May 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. private void Derror(string XmlFile)
  2.         {
  3.             bool flag = false;
  4.  
  5.             if (File.Exists(XmlFile))
  6.             {
  7.                 string[] array = File.ReadAllLines(XmlFile);
  8.                 for (int i = 0; i < array.Length; i++)
  9.                 {
  10.                     if (array[i].Contains("&"))
  11.                     {
  12.                         string str = array[i].Replace("&", "&");
  13.                         array[i] = array[i] + str;
  14.                         flag = true;
  15.                     }
  16.                 }
  17.                 if (flag)
  18.                 {
  19.                     File.WriteAllLines(XmlFile, array);
  20.                 }
  21.             }
  22.             else
  23.             {
  24.                 // Could not find the XML file
  25.             }
  26.  
  27.         }
Add Comment
Please, Sign In to add comment