芭
芭芭拉
Unregistered / Unconfirmed
GUEST, unregistred user!
以下方法可以实现,可却没有创建应用程序名,如何也一起创建应用程序名.
var I: IADsContainer; ADs: IADs;
if ADsGetObject('IIS://localhost', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
ADs := IADs(I.GetObject('IIsWebServer', '1'));
if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then
begin
ADs := IADs(I.GetObject('IIsWebVirtualDir', 'Root'));
if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then
begin
ADs := IADs(I.Create('IIsWebVirtualDir', 'shdoa'));
ADs.Put('AccessRead', 'True');
ADs.Put('Accesswrite', 'True');
ADs.put('AccessScript','True');
ADs.put('EnableDefaultDoc','false');
ADs.Put('Path', edit1.text);
ADs.SetInfo;
end;
MESSAGEBOX(handle,'安装成功! ','提示',MB_ICONEXCLAMATION+mb_OK);
end;
end;
end;
var I: IADsContainer; ADs: IADs;
if ADsGetObject('IIS://localhost', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
ADs := IADs(I.GetObject('IIsWebServer', '1'));
if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then
begin
ADs := IADs(I.GetObject('IIsWebVirtualDir', 'Root'));
if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then
begin
ADs := IADs(I.Create('IIsWebVirtualDir', 'shdoa'));
ADs.Put('AccessRead', 'True');
ADs.Put('Accesswrite', 'True');
ADs.put('AccessScript','True');
ADs.put('EnableDefaultDoc','false');
ADs.Put('Path', edit1.text);
ADs.SetInfo;
end;
MESSAGEBOX(handle,'安装成功! ','提示',MB_ICONEXCLAMATION+mb_OK);
end;
end;
end;