virtical list

xiaoxiao2021-03-06  38

Using System.directoryServices;

Namespace T {///

/// root's summary description. /// public class ROOT: System.Web.UI.Page {protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.TextBox TextBox1; private void Page_Load (object sender, System.eventargs e) {// Place the user code here to initialize the page}

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {this.button1.click = new system.eventhandler (this.button1_click); this.load = new system.eventhandler (this.page_load);

} #Endregion

private void Button1_Click (object sender, System.EventArgs e) {try {DirectoryEntry rootfolder = new DirectoryEntry ( "IIS: //221.232.129.90/W3SVC/" Context.Request.ServerVariables [ "INSTANCE_ID"] .ToString () " / Root "); // DirectoryEntry Rootfolder = New DirectoryEntry (" IIS: //192.168.0.100/w3svc/ " context.request.servervariables [" instance_id "] .tostring () " / root ");

// DirectoryEntry newVirDir = rootfolder.Children.Add (TextBox1.Text.ToString (), "IIsWebVirtualDir"); DirectoryEntry newVirDir = rootfolder.Children.Add ( "AB", "IIsWebVirtualDir"); newVirDir.Invoke ( "AppCreate", True); newvirdir.commitchanges (); rootfolder.commitchanges ();} catch (invalidcastexception ex) {response.write (ex. measureage);}

转载请注明原文地址:https://www.9cbs.com/read-81441.html

New Post(0)