car00t_____
New Member
Okay, so I am trying to store a xml file to the desktop, but that gives me the System.IO.IOException exception. What happens is that the first time I am running my code and the file does not exists yet, it works. But the moment I need to save the file again, but it already exists it comes up with there error.This is very strange, since no program is using. I am running my game in debug mode using visual studio 2010.Place where I send data to save\[code\]public void StoreSaveGame(SaveGame saveGame){ XmlDocument doc = saveGame.GetXmlDoc(); string fileName = "Custom_Map"; string storageLocation = Constants.MAPS_DIRECTORY; XmlFile xmlFile = new XmlFile(storageLocation, fileName); xmlFile.SaveXmlFile(doc); saveLoadIndicator.SetIndicatorState(SaveLoadIndicatorState.SavingComplete);}\[/code\]XmlFile where I do the actual saving\[code\]public void SaveXmlFile(XmlDocument doc){ doc.Save(dataDirectoryPath + fileName);}\[/code\]The path is correct, it just pops up with the exception, which again is strange, since no program is supposed to be using it. Propably visual studio is using it or something.The path is located in the installation dir.
example:
My game is installed in the folder myGame1. Then the xmlFile should be stored in /Data/Maps/Custom_Map.xml, thus the entire url is myGame1/Data/Maps/Custom_Map.xml.Does anyone knows what is going wrong here?
example:
My game is installed in the folder myGame1. Then the xmlFile should be stored in /Data/Maps/Custom_Map.xml, thus the entire url is myGame1/Data/Maps/Custom_Map.xml.Does anyone knows what is going wrong here?