Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello,

please, how to create
<location> (<location path="sitename/filename.ext">)

element direct under
<configuration>

element to applicationhost.config?

The point is, that module "Bit rate throttling" is through this way assign settings to specific file with specific allowed bandwidth, but this is not under any configuration sections and that is main problem (sections in config are pretty good selectable)

With
using Microsoft.Web.Administration;

can by used in c# application
using (ServerManager serverManager = new ServerManager())
            {
                Configuration config = serverManager.GetApplicationHostConfiguration();

                serverManager.CommitChanges();
            }

and there are methods GetLocationPaths, RenameLocationPath and RemoveLocationPath, all of these functionalities are perfect, but I can't find anything to create locationpath.

this is full specific for one file for module :
XML
<location path="Default/bkg-blu.jpg">
        <system.webServer>
            <media>
                <bitrateThrottling maximumThrottleRateKbps="333" />
            </media>
        </system.webServer>
    </location>


Best regards,

Jan
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900