ASP. NET connection method with password access

Source: Internet
Author: User

Although it is very easy to crack access with a password, it is still necessary for some security considerations.

1. Add a password for access

Open Microsoft Access, select "file-open", select the mdb database file to be encrypted, and expand the "open" button (Note: There is a drop-down option next to the button ), select "open in exclusive mode ". After opening the mdb database file (weste_net.mdb database is opened here), select "tool-security-set Database Password ", enter the same password in the "password" and "verify" text boxes to close the database.

2. corresponding connection string

Add in Web. config

<Deleetask> <add key = "oledsn" value = "provider = Microsoft. Jet. oledb.4.0; Data Source ="/> <add key = "olefile" value = "~ /Database/weste_net.mdb; "/> </appsettings>

Write in the corresponding connection

String strconn = configurationsettings. appsettings ["oledsn"] + server. mappath (configurationsettings. deleetask[ "olefile"]. trim () + "jet oledb: Database Password = 123456"; // The Database Password is the set password.
Oledbconnection conn = new oledbconnection (strconn );

In this way, you can.

Provider = Microsoft. Jet. oledb.4.0; Data Source = D: \ bin \ debug \ dB. mdb; persist Security info = true; Jet oledb: Database Password = 10

Provider = Microsoft. Jet. oledb.4.0; Data Source = "" D: \ AA. mdb ""; Jet oledb: Database Password = 1 ";

====================

// The following is the solution --------------------------------
1. Enter the doscommand line
2. CD \
3. cd c: \ WINDOWS \ microsoft.net \ framework \ v2.0.50727
4. Run the command aspnet_regiis-ga administrator // note: the Administrator is the current logon user name.
5. aspnet_regiis-I-enable
6. net stop IISADMIN
7. Net start w3svc
// For more information, see aspnet_regiis.exeProgramIt is in the c: \ windows \ microsoft.net \ framework \ v2.0.50727 directory. If you are not using Windows XP SP2, search for the program and run the same command.

 

Cause of the error:

Install Visual Studio 2005 first and then install IIS. As a result, Asp.net is not successfully registered.

========================

When accessing the Asp.net page, server application unavailable may receive the following error message when you try to view the page in the ASP. NET application:

Server application unavailable

The Web application you are attempting to access on this web server is currently unavailable. Please hit the "refresh" button in your web browser to retry your request.

Administrator Note: an error message detailing the cause of this specific request failure can be found in the system event log of the Web server. please review this log entry to discover what caused this error to occur.

The following error message is displayed in the Application Event Log:

Aspnet_wp.exe cocould not be started. hresult for the failure: 80070005

Event Type: Error
Event Source: ASP. NET 1.1.4322.0
Event Type: None
Event ID: 1084
Date: 2005-12-10
Event: 0:00:44
User: N/
COMPUTER: nhucc0.
Description:
Aspnet_wp.exe cocould not be started. the error code for the failure is 80070545. this error can be caused when the worker process account has insufficient rights to read. net Framework files. please ensure that. net Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account. this problem occurs because the process model User Account (ASPnet by default) does not have the correct user permissions for the required system files and folders ASP. NET workflow.

To solve this problem, verify that the ASPNET account has the following correct user permissions:

• % Windir % \ Microsoft. NET \ framework \Version\ Temporary ASP. NET file:Full Control
• % WINDIR % \ Temp:Full Control
• Application Folder:Read
• % Installroot % level (for example, % WinDir % \ Microsoft. NET \ framework \Version):Read
• % Windir % \ assembly:Read

Note:: This is the Global Assembly cache. You cannot directly use Windows Resource Manager to edit the ACL of this folder. Open the command window and run the following command:

Cacls % WinDir % \ assembly/e/T/P domain \ useraccount: R

Before using Windows Resource Manager, run the following command to cancel registration of shfusion. dll:

Regsvr32-u shfusion. dll.

After setting user permissions in Windows Resource Manager, run the following command to re-register shfusion. dll:

Regsvr32 shfusion. dll
• The website root directory (for example, % root % \ Inetpub \ wwwroot) or the default website path:Read
• % Windir % \ system32:Read
(Generally, the ASPNET account has been granted the user permissions of user group members .)

Status. change the password of your ASPNET account periodically. Each time you install the product, you will reset the password for the ASPNET account. This is caused by design.
====================
Replace: space and carriage return characters in the template
Dd. Replace ("\ r \ n", "<br>"). Replace ("", "& nbsp ;");

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.