I have database path mentioned in this file, along with the location so anybody can go and mess with the database, that is the reason i want to secure this file along with other code.
Main Topics
Browse All TopicsIs it possible to publish a website without web.config, and how secure the code will be after publishing, any body view the classes inside the dll created in the published folder..
Is there a better way to secure the asp.net web application code.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
just users who have direct access to your web directory can see the contents of there , so they should be admin.
if you want to hide those information from users who access to your web directory, you can encrypt them by using two way encryption, I mean you can put encrypted password there and decrypt it when you want to use it.
http://www.codeproject.com
> IIS so the user will know the location and can see the web.config file so i want to protect the web,config
Sorry, but I'm afraid I don't really follow. What do you mean with "the user"? Nobody can see the web.config file, unless they sit behind the computer or have remote desktop access to the computer running your IIS. But if that's the case, you should use regular Vista / XP user management to prevent access to that location. Better yet: simply don't allow others to sit behind your computer.
PS: what would you want to do about someone deleting your other files (aspx)? And what about someone adding an aspx. file that does nothing more then reading your web.config and dumping its contents (in case you encrypt it, there's still little security as long as people can simply access your files: all security in existence have one thing in common, don't give them the same access you have, otherwise security is not possible).
Business Accounts
Answer for Membership
by: abelPosted on 2009-10-04 at 05:09:07ID: 25488951
Web.config contains information about your website, what language is used, how it should be compiled, what version of .NET should be used and what libraries should be installed. Removing it is like removing all road signs from a road: you won't know where to drive anymore, neither does the ASP.NET.
Why would you want to do this if I may ask?