It is a very old topic to Prevent Access Database downloads. There are also many discussions on the Internet. Here we will only discuss how to Prevent Access Database downloading under ASP. NET, some of which are a summary of previous methods, and some are self-built. There may be imperfections or even errors. You are welcome to point out and make progress together.
Currently, the following solutions are available:
1. Place database files outside the site directory
2. Set the IIS directory permission for storing database files to unreadable (IIS Information Service Management-> select the directory to be set-> right-click-> properties-> Directory tab-> cancel read check box)
3. Use ODBC Data sources
The above three methods are classic and secure, and suitable for direct server operations (because the three methods require direct server operations ), of course, this is also a solution to prevent access downloading on the ASP platform.
There is also a solution under ASP, that is to add a long binary table to the database, and then change the file suffix. ASP. (For details, refer to the corresponding data table of the Forum database)
4. rename your access *. asax: Because ASP. in the processing mechanism of net, such requests are directly rejected by default, and there are no problems such as the resource consumption in the resolution process mentioned above. According to this idea, you can also rename access to *. config, *. VB, *. CS, and so on.
5. Place your access in your application Program Root bin directory (that is, the directory where you place the DLL file): It has been found that IIS is configured by default to reject direct access to files in the bin directory to protect DLL requests, in fact, it also protects other files in the bin directory. However, some people have doubts about this method: Will there be such a consequence? During database read/write, the Assembly will be frequently refreshed, and the session and application will be continuously lost?
6. Another method (Personal originality) is to use it. Net access permission control to prohibit anonymous users from downloading the database, as follows:
Open the configuration file web. config and add the following configuration under the configuration node:
<; Location Path = "Database">
<; System. Web>
<; Authorization>
<; Deny users = "*"/>
<;/Authorization>
<;/System. Web>
<;/Location>
Database is the directory where your database files are stored. If it is the root directory, use <; locateon Path = "~ /Database. aspx "> replace. After the preceding configuration is added, modify the database suffix. Aspx and other file types that need to be parsed by IIS.
Because the <; deny users = "*"/> statement limits any anonymous users to access all files to be parsed In the Path = "Database.
Note: whether in ASP or. Net, directly change the suffix of the Access database. ASP and. Add "#" or a space in the file name before the file name.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service