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');
...全文
13 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
ttt2 2003-05-16
有人作过吗?
回复
reedseutozte 2003-05-16
procedure SetFTPDirectory;
var
hk : HKEY;
dwDisposition : DWORD;
dwTemp: DWORD;
ValueType, ValueSize: DWORD;
DataBuf: array [0..MAX_LENGTH - 1] of Char;
begin
if (Ver_System = WINNT) and (SMPSetup.Selected or SCPSetup.Selected) then
begin
RegCreateKeyEx($80000002, 'SYSTEM\CurrentControlSet\Services\MSFTPSVC\Parameters',
0, nil, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nil,
hk, @dwDisposition);
dwTemp := 0;
RegSetValueEx(hk, 'AllowAnonymous', 0, REG_DWORD, PByte(@dwTemp), SizeOf(dwTemp));
RegSetValueEx(hk, 'AnonymousOnly', 0, REG_DWORD, PByte(@dwTemp), SizeOf(dwTemp));
RegCloseKey(hk);
RegCreateKeyEx($80000002, 'SYSTEM\CurrentControlSet\Services\MSFTPSVC\Parameters\Virtual Roots',
0, nil, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nil,
hk, @dwDisposition );
ValueType := REG_SZ;
ValueSize := MAX_LENGTH;
if RegQueryValueEx(hk, '/,', nil, @ValueType, PBYTE(@DataBuf), @ValueSize) <> ERROR_SUCCESS then
RegSetValueEx(hk, '/', 0, REG_SZ, PChar(Ver_Directory + '\Zxin10,,3'), StrLen(PChar(Ver_Directory + '\Zxin10,,3')))
else
RegSetValueEx(hk, '/,', 0, REG_SZ, PChar(Ver_Directory + '\Zxin10,,3'), StrLen(PChar(Ver_Directory + '\Zxin10,,3')));
if SMPSetup.Selected then
RegSetValueEx(hk, '/CheckLog,', 0, REG_SZ, PChar(Ver_Directory + '\Zxin10\CheckLog,,3'), StrLen(PChar(Ver_Directory + '\Zxin10\CheckLog,,3')));
RegCloseKey(hk);
end;
end;
回复
相关推荐
发帖
网络通信/分布式开发
创建于2007-08-02

1573

社区成员

Delphi 网络通信/分布式开发
申请成为版主
帖子事件
创建了帖子
2003-05-16 10:08
社区公告
暂无公告