473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

direct edit of the ii6s metabase.xml using c# or vb.net


I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this
code, trying to get a list of all defined websites, and write their name to
console, but it does not seem to work, would appreciate any pointers:

-----------
Try
Dim doc As New XmlDocument
Dim nodelist As XmlNodeList
Dim node As XmlNode

'Load the Xml file
'doc.Load("c:\windows\system32\inetsrv\metabase.xm l")

'Get the list of name nodes

nodelist = doc.SelectNodes("/MBProperty/IIsWebServer")

'Loop through the nodes

For Each node In nodelist
Dim siteName =
node.Attributes.GetNamedItem("ServerComment").Valu e
Console.WriteLine("Site: " & siteName)
Next

Catch errorVariable As Exception
'Error trapping
Console.Write(errorVariable.ToString())
End Try
-----------

Here's a sample metabase.xml file:
http://www.winnetmag.com/Files/11/22281/22281.zip

Nov 15 '05 #1
1 1686
Cor
Hi Roger,

Will this work for you?

(I would put on Option Strict On if I was you, there where some little
errors, but had nothing to do with this.)

Cor

\\\
Dim doc As New Xml.XmlDocument
Dim nodelist As Xml.XmlNodeList
Dim node As Xml.XmlNode
'Load the Xml file
doc.Load("c:\test\metabase.xml")
'Get the list of name nodes
nodelist = doc.GetElementsByTagName("IIsWebServer")
'Loop through the nodes
For Each node In nodelist
Dim siteName As String =
node.Attributes.GetNamedItem("ServerComment").Valu e()
MessageBox.Show("Site: " & siteName)
Next
///
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would appreciate any pointers:

-----------
Try
Dim doc As New XmlDocument
Dim nodelist As XmlNodeList
Dim node As XmlNode

'Load the Xml file
'doc.Load("c:\windows\system32\inetsrv\metabase.xm l")

'Get the list of name nodes

nodelist = doc.SelectNodes("/MBProperty/IIsWebServer")

'Loop through the nodes

For Each node In nodelist
Dim siteName =
node.Attributes.GetNamedItem("ServerComment").Valu e
Console.WriteLine("Site: " & siteName)
Next

Catch errorVariable As Exception
'Error trapping
Console.Write(errorVariable.ToString())
End Try
-----------

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Keith | last post by:
I think we have a corrupt IIS metabase on our web cluster. The controller is replicating the problem to the members. What steps can we take to confirm our IIS metabase is intact? I would...
1
by: Roger | last post by:
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would...
5
by: David Veeneman | last post by:
I had to reformat my Windows XP Professional development machine yesterday and reinstall everything, including IIS and VS 2005. I thought I had worked out the procedure to get ASP.NET up and...
0
by: and251076 | last post by:
Buongiorno, da pochi giorno ho installato la versione 2005 di Visual Studio, ma ahi mè non funziona tutto perfettamente. Infatti non riesco ad eseguite le miei applicazioni web in localhost. Se...
0
by: Will Holley | last post by:
I have a problem with cache headers which I cannot track down. We are running IIS6 on Windows Server 2003 and ASP.NET 2.0. Our application has an installer which sets up our caching options in...
1
by: Schemer | last post by:
Hello, I tried to load a web page from my local IIS, and got this error: ----------------------------- Failed to access IIS metabase. Description: An unhandled exception occurred during the...
2
by: =?Utf-8?B?SmliZXkgSmFjb2I=?= | last post by:
Hi: I'm getting this error when I try to browse to a .aspx page that is located on a virtual directory located on my Win XP Pro machine. There's more text in the page that is displayed that says...
2
sujithkrishnan
by: sujithkrishnan | last post by:
hi all... please help me in resolving this error.. i created a web service and i am not able to consume it in my app. When i browse that page am gettin an ERRO as follows.. Exception...
3
sujithkrishnan
by: sujithkrishnan | last post by:
hi all... please help me in resolving this error.. i created a web service and i am not able to consume it in my app. When i browse that page am gettin an ERROR as follows.. Exception...
1
by: nagmvs | last post by:
Hello I am unable to upload More than 200kb in to my server and also i can downlaod only less than 4MB file from my server .When i am searching in internet i found solution as u can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.