Asp.net access to the network ing Disk

Source: Internet
Author: User

Recently, I received a request to access files on other hosts. I thought I had to map the files with a network ing disk and then read the local files. I didn't expect to solve the permission problem. After searching the information, the solution is as follows:

  1. Of course, it is mapped to the network address. Suppose the ing is "Z: \" here. Generally, a user name and password will be provided to you for security purposes. Suppose it is user1 and pwd1.
  2. Add a virtual directory in IIS. If it is "/out", it indicates "Z :\"
  3. Add a user in Windows user management, including the user name and password provided above (user1 and pwd1 here), and change the user to the Administrator group, if necessary, you can restrict this user from logging on to the machine remotely to ensure certain security.
  4. Add a web directory to the directory where the ing disk needs to be read. config, in system. add a node under the Web node: <identity impersonate = "true" username = "user1" Password = "pwd1"/> (the user name and password are the same as above)

In this way, all the settings will be fine. Read the content in the/out directory in the test: directory. exists (server. mappath ("/out");, it should be set back to true.

Related Article

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.