General Topics include: .NET Framework
Note: Most posts can be categorized into one of the forums below, where experts on that topic will be able to help you find a solution to your problem faster and more efficiently.

Enjoy an ad free experience by logging in. Not a member yet? Register.
Go Back  Xtreme .NET Talk > .NET > General > How to Protect XML file

Thread Tools Display Modes
Old 08-04-2008, 05:20 AM
surajit_shah surajit_shah is offline
Join Date: Jul 2008
Posts: 5
surajit_shah is on a distinguished road
Question How to Protect XML file

I have a windows application in my application there is a xml file which is updated on every 30 seconds by the application automatically.I don't want the external user to update or tamper the xml file.So how can I Protect the xml file so that other users can not read or update the xml file.

Help me.

Thanks in advance.
Reply With Quote
Old 08-04-2008, 05:11 PM
roger_wgnr roger_wgnr is offline

Preferred language:
Join Date: Mar 2008
Location: San Antonio, TX
Posts: 9
roger_wgnr is on a distinguished road
Default Re: How to Protect XML file

Originally Posted by surajit_shah View Post
.So how can I Protect the xml file so that other users can not read or update the xml file..
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
the FileShare can be None which will cause all access by other programs to fail until it is released. You can also set it to Read to allow read only access.
Reply With Quote
Old 08-11-2008, 10:18 AM
Nate Bross Nate Bross is offline

Preferred language:
Join Date: Apr 2005
Location: Chicago, IL
Posts: 601
Nate Bross is on a distinguished road
Default Re: How to Protect XML file

Out of curiosity, why do you need to update an XML file every 30 seconds? Do other programs read this XML file, or is it only for use by your application?

I'm just wondering if there might be a better way to achieve your desired result? Even if it's a small file, disk IO every 30 seconds could start to impact system performance.

Please use the [vb]/[cs] tags on posted code.
Please post solutions you find somewhere else.
Follow me on Twitter here.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
add node to xml file without XML document inter Database / XML / Reporting 2 08-22-2005 06:46 AM
Saving XML data to an XML File from Save As Dialog Kedhrin Database / XML / Reporting 11 07-15-2005 05:40 PM
how to extract info from a xml file follow a extraction rule in a xsl file ? van Database / XML / Reporting 0 11-10-2003 12:10 PM
To all File IO Gurus >> Async XML File Input element Directory / File IO / Registry 1 10-30-2003 01:21 PM
XML Schema from XML file hog Database / XML / Reporting 3 08-21-2003 06:25 AM


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..