计算机二级

3773考试网计算机等级考试计算机二级正文

如何使用Delphi创建IIS虚拟目录

来源:青年人 2010-8-17 10:08:55

 

unit MainUnt;
  interface
  uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FileCtrl, Buttons,Activeds_TLB;
  type
  TIISConfigFrm = class(TForm)
  edtAlias: TEdit;
  Label1: TLabel;
  dlbIIS: TDirectoryListBox;
  dcbIIS: TDriveComboBox;
  Label2: TLabel;
  edtPath: TEdit;
  GroupBox1: TGroupBox;
  cbRead: TCheckBox;
  cbScript: TCheckBox;
  cbExecute: TCheckBox;
  cbWrite: TCheckBox;
  cbBrowse: TCheckBox;
  bbtOK: TBitBtn;
  lblPath: TLabel;
  procedure dlbIISChange(Sender: TObject);
  procedure bbtOKClick(Sender: TObject);
  procedure FormCreate(Sender: TObject);
  private
  { Private declarations }
  public
  { Public declarations }
  end;
  function ADsGetObject(const PathName: WideString; const GUID:TGUID; out I: IUnknown): HRESULT; stdcall;
  var
  IISConfigFrm: TIISConfigFrm;
  implementation
  {$R *.dfm}
  function ADsGetObject;external \’ActiveDS.dll\’ name \’ADsGetObject\’;
  procedure TIISConfigFrm.dlbIISChange(Sender: TObject);
  begin
  edtPath.Text:=dlbIIS.Directory;
  end;
  procedure TIISConfigFrm.bbtOKClick(Sender: TObject);
  var
  I: IADsContainer;
  ADs: IADs;
  begin
  if Length(Trim(edtAlias.Text))=0 then begin
  Application.MessageBox(\’別名不可以為空!\’,\’警告\’);
  Exit;
  end;

 
 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1