c# - Block access to project directory programmatically -


i have wcf service running in visual studio. when running service, project's file structure shows in browser, , have directory containing files user interface.

in web.config, have option (interfaceenabled) enabling/disabling interface. when set disabled, disable access directory containing interface files, don't know how this.

i know setting "hiddensegment" in web.config can this, need programmatically based on value of interfaceenabled.

how can this? in advance!

without coding whole thing use

string setting = webconfigurationmanager.appsettings["settingname"] 

then if setting true or ever condition like, change directory permissions using directory.setaccesscontrol

there few articles on changing folder permissions in c# unsure if idea begin changing perms folder while app running might cause issues or not work.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -