.resource File

  • Thread starter Thread starter ying
  • Start date Start date
Y

ying

I use a .resource file to save some name-value
inforamtion. I use resource manager class to create the
resource file and read out information when the system
starts.

The problem I met is: when I distribute the system to
user, they read the information out without any problem,
but when they try to write new name-value to the resource
file. They met problem: .resouce file was used by another
process, and can not create a new one. Or the access to
the file is denied.

This problem only happen sometimes. Delete the file is a
way to fix it. However, if the file is part of
distribution set, it can not be deleted.

Anyone meets the problem? Any suggestion is appreciated.

Ying
 
Check to make sure that the routine for reading the file is actually closing
the file prior to the user trying to write to it. You cannot write to a
file that is open by another process.
 
Thank you for your reply, the following code is read
information out, I couldn't find a method that close the
open file. Could you tell me how to close it?

rm = ResourceManager.CreateFileBasedResourceManager
("MyProgram", ".", Nothing)
boolCommunicate = rm.GetObject("Communicate")

dtRunTime = rm.GetObject("RunTime")


Thanks
 
Sorry, my mistake.

I thought you were opening a file and reading from it.

That doesn't appear to be the case here.
 
Back
Top