这是我的代码,在2000试过成功.
================
            string strSchema= "";
            string strRootSubPath = "";
            strSchema = "IIsWebVirtualDir";
            strRootSubPath = "/W3SVC/1/Root";
            DirectoryEntry deRoot= new DirectoryEntry("IIS://" + "YourServerName" + strRootSubPath);            try
            {
                deRoot.RefreshCache();
                DirectoryEntry deNewVDir = deRoot.Children.Add("AAA",strSchema);
                deNewVDir.Properties["Path"].Insert(0,"C:\\Temp");
                deNewVDir.CommitChanges();
                deRoot.CommitChanges();                // Create a Application
                if (strSchema == "IIsWebVirtualDir")
                    deNewVDir.Invoke("AppCreate",true);                // Save Changes
                deNewVDir.CommitChanges();
                deRoot.CommitChanges();
                deNewVDir.Close();
                deRoot.Close();
                lblStatus.Text = "Virtual Directory  has been created";            }
            catch (Exception ex)
            {
                lblStatus.Text = "Error: " + ex.Message;
            }