if some body clicks on the Xml file, it should not open in the explorer in the sense user is not allowed to modify the file.
can any one suggest me how to do this programatically?
if some body clicks on the Xml file, it should not open in the explorer in the sense user is not allowed to modify the file.
can any one suggest me how to do this programatically?
you could always encode it but and then decode it in a temp file
or into memory only, if that a possiblity.
Make the file read-only.
Free code: http://sol-biotech.com/code/.
It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw
to block a file from write/read acess while open specify FILE_SHARE_DELETE,FILE_SHARE_READ or FILE_SHARE_WRITE with CreateFile function.
http://msdn.microsoft.com/library/de...createfile.asp
for posix open().... I don't know
http://www.opengroup.org/onlinepubs/.../xsh/open.html
i am awre of this but the problem is every time i have to do encode and decode. Even this is not good one. Becoz he can open the Encoded file and deletes some thing, then the worest case is i can not decode it.
user can select the file, right click on the properties dialog box , Uncheck the readonly option. After that he will be able to do editing.
It's really not very nice to try to stop the user from editing plain text files on his own system. That's why that box can be unchecked. Perhaps you should consider saving the data in a binary format, or as a very minimalist solution, change the file extension of the XML file to something that Windows won't have registered with a program.Originally Posted by anil_beloved
Away.