application pool - Get List of AppPools from IIS -


i'm using vb.net 3.5 asp.net , need list apppools names iis , show them in dropdownlist. please ?

thanks

finally found solution , here methods ..

public function getapppoolnames() list(of string)     dim root system.directoryservices.directoryentry = getdirectoryentry("iis://localhost/w3svc/apppools")     'directoryentry root = new directoryentry("iis://localhost/w3svc/1/root");     dim applist new list(of string)     if root nothing      else         each dir directoryentry in root.children             dim pr system.directoryservices.propertycollection = dir.properties             'applicationpool pool = new applicationpool();             'pool.name = dir.name;             'dropdownlist1.items.add(pool.name);             applist.add(dir.name)         next      end if     return applist end function private function getdirectoryentry(byval path string) directoryentry     dim root directoryentry = nothing     try         root = new directoryentry(path)     catch         'console.writeline("could not access node")         return nothing     end try     if root nothing         'console.writeline("could not access node")         return nothing     end if     return root end function 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -