简体   繁体   中英

How to change web.config file of a different web site?

I have 2 web applications:

  1. Main Application
  2. Self Portal

I want to change the web.config file of the Self Portal from my Main Application .

In the main application I get the Self Portal URL (for example: http://servername/SelfPortal).

How can I open its configuration file and edit it?

Thanks, Inbal.

Since you have access to the filesystem, you can open the .config file as you would with any XML file.

Using XDocument you can load, manipulate and save the file.

There are other ways to open the file that are strongly typed (look at the ConfigurationManager , the Open*** methods) if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM