c# - Unlock section in applicationHost.config programmatically -



c# - Unlock section in applicationHost.config programmatically -

i have checked servermanagaer class , gives lot of functionality work iis, contains methods update values in applicationhost.config file, can't fine way unlock sections there.

for illustration purpose appcmd.exe unlock config command used. need same programmatically.

as said can run appcmd process. hint if don't console popup can redirect output.

here code msdn

// start kid process. process p = new process(); // redirect output stream of kid process. p.startinfo.useshellexecute = false; p.startinfo.redirectstandardoutput = true; p.startinfo.filename = "write500lines.exe"; p.start(); // not wait kid process exit before // reading end of redirected stream. // p.waitforexit(); // read output stream first , wait. string output = p.standardoutput.readtoend(); p.waitforexit();

more details see here

c# .net iis

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -