📄 iisext_tlb.pas
字号:
// Default Interface: IISApp2
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TIISExtAppProperties= class;
{$ENDIF}
TIISExtApp = class(TOleServer)
private
FIntf: IISApp2;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TIISExtAppProperties;
function GetServerProperties: TIISExtAppProperties;
{$ENDIF}
function GetDefaultInterface: IISApp2;
protected
procedure InitServerData; override;
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IISApp2);
procedure Disconnect; override;
procedure GetInfo;
procedure SetInfo;
function Get(const bstrName: WideString): OleVariant;
procedure Put(const bstrName: WideString; vProp: OleVariant);
function GetEx(const bstrName: WideString): OleVariant;
procedure PutEx(lnControlCode: Integer; const bstrName: WideString; vProp: OleVariant);
procedure GetInfoEx(vProperties: OleVariant; lnReserved: Integer);
procedure AppCreate(bSetInProcFlag: WordBool);
procedure AppDelete;
procedure AppDeleteRecursive;
procedure AppUnLoad;
procedure AppUnLoadRecursive;
procedure AppDisable;
procedure AppDisableRecursive;
procedure AppEnable;
procedure AppEnableRecursive;
procedure AppGetStatus(out pdwStatus: LongWord);
procedure AspAppRestart;
procedure AppCreate2(lAppMode: Integer);
function AppGetStatus2: Integer;
property DefaultInterface: IISApp2 read GetDefaultInterface;
property Name: WideString read Get_Name;
property Class_: WideString read Get_Class_;
property GUID: WideString read Get_GUID;
property ADsPath: WideString read Get_ADsPath;
property Parent: WideString read Get_Parent;
property Schema: WideString read Get_Schema;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TIISExtAppProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TIISExtApp
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TIISExtAppProperties = class(TPersistent)
private
FServer: TIISExtApp;
function GetDefaultInterface: IISApp2;
constructor Create(AServer: TIISExtApp);
protected
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
public
property DefaultInterface: IISApp2 read GetDefaultInterface;
published
end;
{$ENDIF}
// *********************************************************************//
// The Class CoIISExtServer provides a Create and CreateRemote method to
// create instances of the default interface IADsServiceOperations exposed by
// the CoClass IISExtServer. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoIISExtServer = class
class function Create: IADsServiceOperations;
class function CreateRemote(const MachineName: string): IADsServiceOperations;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TIISExtServer
// Help String :
// Default Interface: IADsServiceOperations
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TIISExtServerProperties= class;
{$ENDIF}
TIISExtServer = class(TOleServer)
private
FIntf: IADsServiceOperations;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TIISExtServerProperties;
function GetServerProperties: TIISExtServerProperties;
{$ENDIF}
function GetDefaultInterface: IADsServiceOperations;
protected
procedure InitServerData; override;
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
function Get_Status: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IADsServiceOperations);
procedure Disconnect; override;
procedure GetInfo;
procedure SetInfo;
function Get(const bstrName: WideString): OleVariant;
procedure Put(const bstrName: WideString; vProp: OleVariant);
function GetEx(const bstrName: WideString): OleVariant;
procedure PutEx(lnControlCode: Integer; const bstrName: WideString; vProp: OleVariant);
procedure GetInfoEx(vProperties: OleVariant; lnReserved: Integer);
procedure Start;
procedure Stop;
procedure Pause;
procedure Continue;
procedure SetPassword(const bstrNewPassword: WideString);
property DefaultInterface: IADsServiceOperations read GetDefaultInterface;
property Name: WideString read Get_Name;
property Class_: WideString read Get_Class_;
property GUID: WideString read Get_GUID;
property ADsPath: WideString read Get_ADsPath;
property Parent: WideString read Get_Parent;
property Schema: WideString read Get_Schema;
property Status: Integer read Get_Status;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TIISExtServerProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TIISExtServer
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TIISExtServerProperties = class(TPersistent)
private
FServer: TIISExtServer;
function GetDefaultInterface: IADsServiceOperations;
constructor Create(AServer: TIISExtServer);
protected
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
function Get_Status: Integer;
public
property DefaultInterface: IADsServiceOperations read GetDefaultInterface;
published
end;
{$ENDIF}
// *********************************************************************//
// The Class CoIISExtDsCrMap provides a Create and CreateRemote method to
// create instances of the default interface IISDsCrMap exposed by
// the CoClass IISExtDsCrMap. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoIISExtDsCrMap = class
class function Create: IISDsCrMap;
class function CreateRemote(const MachineName: string): IISDsCrMap;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TIISExtDsCrMap
// Help String :
// Default Interface: IISDsCrMap
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TIISExtDsCrMapProperties= class;
{$ENDIF}
TIISExtDsCrMap = class(TOleServer)
private
FIntf: IISDsCrMap;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TIISExtDsCrMapProperties;
function GetServerProperties: TIISExtDsCrMapProperties;
{$ENDIF}
function GetDefaultInterface: IISDsCrMap;
protected
procedure InitServerData; override;
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IISDsCrMap);
procedure Disconnect; override;
procedure GetInfo;
procedure SetInfo;
function Get(const bstrName: WideString): OleVariant;
procedure Put(const bstrName: WideString; vProp: OleVariant);
function GetEx(const bstrName: WideString): OleVariant;
procedure PutEx(lnControlCode: Integer; const bstrName: WideString; vProp: OleVariant);
procedure GetInfoEx(vProperties: OleVariant; lnReserved: Integer);
procedure CreateMapping(vCert: OleVariant; const bstrNtAcct: WideString;
const bstrNtPwd: WideString; const bstrName: WideString;
lEnabled: Integer);
procedure GetMapping(lMethod: Integer; vKey: OleVariant; out pvCert: OleVariant;
out pbstrNtAcct: OleVariant; out pbstrNtPwd: OleVariant;
out pbstrName: OleVariant; out plEnabled: OleVariant);
procedure DeleteMapping(lMethod: Integer; vKey: OleVariant);
procedure SetEnabled(lMethod: Integer; vKey: OleVariant; lEnabled: Integer);
procedure SetName(lMethod: Integer; vKey: OleVariant; const bstrName: WideString);
procedure SetPwd(lMethod: Integer; vKey: OleVariant; const bstrPwd: WideString);
procedure SetAcct(lMethod: Integer; vKey: OleVariant; const bstrAcct: WideString);
property DefaultInterface: IISDsCrMap read GetDefaultInterface;
property Name: WideString read Get_Name;
property Class_: WideString read Get_Class_;
property GUID: WideString read Get_GUID;
property ADsPath: WideString read Get_ADsPath;
property Parent: WideString read Get_Parent;
property Schema: WideString read Get_Schema;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TIISExtDsCrMapProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TIISExtDsCrMap
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TIISExtDsCrMapProperties = class(TPersistent)
private
FServer: TIISExtDsCrMap;
function GetDefaultInterface: IISDsCrMap;
constructor Create(AServer: TIISExtDsCrMap);
protected
function Get_Name: WideString;
function Get_Class_: WideString;
function Get_GUID: WideString;
function Get_ADsPath: WideString;
function Get_Parent: WideString;
function Get_Schema: WideString;
public
property DefaultInterface: IISDsCrMap read GetDefaultInterface;
published
end;
{$ENDIF}
procedure Register;
resourcestring
dtlServerPage = 'ActiveX';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
class function CoIISExtComputer.Create: IISComputer;
begin
Result := CreateComObject(CLASS_IISExtComputer) as IISComputer;
end;
class function CoIISExtComputer.CreateRemote(const MachineName: string): IISComputer;
begin
Result := CreateRemoteComObject(MachineName, CLASS_IISExtComputer) as IISComputer;
end;
procedure TIISExtComputer.InitServerData;
const
CServerData: TServerData = (
ClassID: '{91EF9258-AFEC-11D1-9868-00A0C922E703}';
IntfIID: '{CF87A2E0-078B-11D1-9C3D-00A0C922E703}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TIISExtComputer.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IISComputer;
end;
end;
procedure TIISExtComputer.ConnectTo(svrIntf: IISComputer);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TIISExtComputer.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TIISExtComputer.GetDefaultInterface: IISComputer;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TIISExtComputer.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TIISExtComputerProperties.Create(Self);
{$ENDIF}
end;
destructor TIISExtComputer.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TIISExtComputer.GetServerProperties: TIISExtComputerProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TIISExtComputer.Get_Name: WideString;
begin
Result := DefaultInterface.Name;
end;
function TIISExtComputer.Get_Class_: WideString;
begin
Result := DefaultInterface.Class_;
end;
function TIISExtComputer.Get_GUID: WideString;
begin
Result := DefaultInterface.GUID;
end;
function TIISExtComputer.Get_ADsPath: WideString;
begin
Result := DefaultInterface.ADsPath;
end;
function TIISExtComputer.Get_Parent: WideString;
begin
Result := DefaultInterface.Parent;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -