i have this .xml file read and display at runtime by vb.net2003. the .xml file is the database which contain various data and its not for adding more data or edited by user so i need to protect the file so that my code can read and display those data. can anyone know how to protect the file. If encrypted can i decrypt it inside my program code and display them as needed.

I would be very grateful if anyone could help me on this.



To prevent other users from accessing the file when you open the file set the FileShare mode to None. Since you did not post any code I am not sure what method you are using to open and update the file. A sample using the would be:


Found only C# code as an example.