When executing the code below it shows an error at opening the file it says the file dict.xml is already in use by some process
It shows error here
FileStream fs = new FileStream("dict.xml", FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream("dict.xml", FileMode.Open, FileAccess.Read);
xmldoc.Load(fs);
xmlnode = xmldoc.GetElementsByTagName("dict");
for (i = 0; i <= xmlnode.Count - 1; i++)
{
w[i] = xmlnode[i].ChildNodes.Item(0).InnerText;
m[i] = xmlnode[i].ChildNodes.Item(1).InnerText;
}
If something else has a lock on the file you should still be able to read it if you specify FileShare.ReadWrite:
using (FileStream fs = new System.IO.FileStream("dict.xml", FileMode.Open, FileAccess.Read, FileShare.ReadWrite) {