Below is my code, I'm opening an xml file and I have a chat name node
within it. By default the node has a value of "mypc" for which I'm
replacing and putting in a new value. I don't know if this is the best
approach but I'm trying it. I can open the stream fine and replace the
text. But when I try to write the stream back, I get an error saying
the file is in use by another process. Any ideas? Thanks in advance
myStreamReader = File.OpenText(" ../Config.xml")
strConfigFile = myStreamReader. ReadToEnd()
myStreamReader. Close()
'-- Get the computer name from the XML
strXMLComputerN ame = Mid(strConfigFi le, InStr(strConfig File,
"<chat_name >") + 11, InStr(strConfig File, "</chat_name") -
(InStr(strConfi gFile, "<chat_name >") + 11))
'-- Replace the default chat name with the pc name
strConfigFile = Replace(strConf igFile, strXMLComputerN ame,
strComputerName )
myStreamWriter = File.CreateText ("../Config.xml")
myStreamWriter. Write(strConfig File)
myStreamWriter. Close()