delphi如何创建iis目录呀,谁有成功的例子
ttt2 2003-05-16 10:08:28 unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,activeds,comobj;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Disp: IDispatch;
begin
Disp := IISNamespace1.GetObject('IIsWebService', 'localhost/w3svc');
Disp := (Disp as IADsContainer).GetObject('IIsWebServer', '1');
Disp := (Disp as IADsContainer).GetObject('IIsWebVirtualDir', 'Root');
Disp := (Disp as IADsContainer).Create('IIsWebVirtualDir', 'DelphiADSITest');
(Disp as IADs).Put('AccessRead', 'True');
(Disp as IADs).Put('Path', 'c:\test');
(Disp as IADs).SetInfo;
end;
为什么不行说 找不到iisnamespace1
Disp := IISNamespace1.GetObject('IIsWebService', 'localhost/w3svc');