Can anybody tell me what is wrong with this code?
The error I am getting is:
'The process cannot access the file "c:\inetpub\ because it is being used by another process'
long lngNextNumber = Find_Next_File_Number();
//File.Create("C:\\inetpub\\ + lngNextNumber + ".xml"
//create the XMLTextWriter
string strNewFile = "c:\\inetpub\\ XmlTextWriter tw = new XmlTextWriter(strNewFile, null);
//set the formatting to indented
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument();
//start creating elements and attributes
tw.WriteStartElement("book"
tw.WriteElementString("title", "Case of the missing cookie"
tw.WriteEndElement();
tw.WriteEndDocument();
//clean up
tw.Flush();
tw.Close();
Thanks,
lfc77
The error I am getting is:
'The process cannot access the file "c:\inetpub\ because it is being used by another process'
long lngNextNumber = Find_Next_File_Number();
//File.Create("C:\\inetpub\\ + lngNextNumber + ".xml"
//create the XMLTextWriter
string strNewFile = "c:\\inetpub\\ XmlTextWriter tw = new XmlTextWriter(strNewFile, null);
//set the formatting to indented
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument();
//start creating elements and attributes
tw.WriteStartElement("book"
tw.WriteElementString("title", "Case of the missing cookie"
tw.WriteEndElement();
tw.WriteEndDocument();
//clean up
tw.Flush();
tw.Close();
Thanks,
lfc77