建立的目录实质上在磁盘是不可见的,是不是要划分一块内存空间出来?
请教一下
谢谢
请教一下
谢谢
解决方案 »
- chart应用,初学都,请懂的进来帮忙解决下,先谢谢了!!!!急!!!50分!!!
- 线程中如何向主线程发消息?即主界面MainForm的消息处理函数怎样才能接受到来自线程的消息!在线等
- 关于制作安装程序的问题
- 请高手指教-------dephi7+fastreport怎样把参数传递个fastreport
- 谈谈大家的编程经历:)
- 关于DbGrid导致数据库迅速增大的问题
- 字符串方面的函数问题。
- stringGrid中如何为每一行设置Hint
- myobject.free和FreeAndNil(myobject)有什么区别呢?
- 请问,Delphi6现在是不是已经没有版权纠纷了
- 高手请进啊]
- !!!将Tfont对象存入数据表并取出!!!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComObj, IISOle_TLB, ActiveDs_TLB;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
function CreateIISVirtualPath(MapPath:String;Path:String):Boolean;
function SetIISRootPathParam:Boolean;
function KillIISPath(MapPath:String):Boolean;
public
{ Public declarations }
end;var
Form1: TForm1;
function ADsGetObject(const PathName: WideString; const GUID: TGUID; out I: IUnknown): HRESULT; stdcallimplementationfunction ADsGetObject;external 'activeds.dll' name 'ADsGetObject'{$R *.DFM}function TForm1.CreateIISVirtualPath(MapPath:String;Path:String):Boolean;
var
I: IADsContainer;
ADs: IADs;
begin
Result:=false;
try
if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
ADs := IADs(I.GetObject('IIsWebServer','1'));
i:=ADs as IADsContainer;
ADs := I.GetObject('IIsWebVirtualDir','Root') as IADs;
i:=ADs as IADsContainer;
ADs := I.Create('IIsWebVirtualDir',MapPath) as IADs;
ADs.Put('AccessRead','True');
ADs.Put('AccessScript','True');
ADs.Put('AccessExecute','True');
file://modify by liguang in 2001-7-8 comeback from shengzhen
file://if operating system is WINDOWS NT4.0+IIS4.0 then this call is error
ADs.Put('AccessSource','True');
ADs.Put('Path',Path);
ADs.SetInfo;
Result:=true;
end;
except
end;
end;function TForm1.SetIISRootPathParam:Boolean;
var
I: IADsContainer;
ADs: IADs;
begin
Result:=false;
try
if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
ADs := IADs(I.GetObject('IIsWebServer','1'));
i:=ADs as IADsContainer;
ADs := I.GetObject('IIsWebVirtualDir','Root') as IADs;
ADs.Put('AccessRead','True');
ADs.Put('AccessScript','True');
ADs.Put('AccessExecute','True');
ADs.Put('AccessSource','True');
ADs.SetInfo;
Result:=true;
end;
except
end;
end;function TForm1.KillIISPath(MapPath:String):Boolean;
var
I: IADsContainer;
ADs: IADs;
begin
Result:=false;
if MapPath='Root' then
exit;
try
if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then
begin
ADs := IADs(I.GetObject('IIsWebServer','1'));
i:=ADs as IADsContainer;
ADs := I.GetObject('IIsWebVirtualDir','Root') as IADs;
i:=ADs as IADsContainer;
ADs := I.GetObject('IIsWebVirtualDir',MapPath) as IADs;
i.Delete(ADs.Get_Schema,ADs.get_Name);
Result:=true;
end;
except
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if CreateIISVirtualPath('WebUser','E:\VC')=true then
MessageBox(GetforegroundWindow,'建立成功!','提示信息',MB_OK)
else
MessageBox(GetforegroundWindow,'建立失败!','提示信息',MB_OK);
end;procedure TForm1.Button2Click(Sender: TObject);
begin
if SetIISRootPathParam=true then
MessageBox(GetforegroundWindow,'修改成功!','提示信息',MB_OK)
else
MessageBox(GetforegroundWindow,'修改失败!','提示信息',MB_OK);
end;procedure TForm1.Button3Click(Sender: TObject);
begin
if SetIISRootPathParam=true then
MessageBox(GetforegroundWindow,'修改成功!','提示信息',MB_OK)
else
MessageBox(GetforegroundWindow,'修改失败!','提示信息',MB_OK);
if CreateIISVirtualPath('WebUser','E:\VC')=true then
MessageBox(GetforegroundWindow,'建立成功!','提示信息',MB_OK)
else
MessageBox(GetforegroundWindow,'建立失败!','提示信息',MB_OK);
end;procedure TForm1.Button4Click(Sender: TObject);
begin
if KillIISPath('WebUser')=true then
MessageBox(GetforegroundWindow,'删除成功!','提示信息',MB_OK)
else
MessageBox(GetforegroundWindow,'删除失败!','提示信息',MB_OK);
end;end.
IStorage and IStream