问题描述
我正在转换Delphi ISAPI dll,在IIS 7.0和7.5上更好地工作。 ISAPI用于从注册表读取其配置,但我想将其转换为使用同一文件夹中的web.config文件。
它可以与CGI正常工作,但是ISAPI是另一回事。我正在使用 GetModuleFileName
来获取模块的路径,当然,它会让我回到IIS工作进程的路径(C:\Windows\SysWOW64 \inetsrv)
有没有办法获取ISAPI DLL的物理路径?
函数GetDllName:string;>解决方案
var
pName:PChar;
begin
GetMem(pName,200);
windows.GetModuleFileName(HInstance,pName,200);
结果:= string(pName);
FreeMem(pName);
结束
I'm converting a Delphi ISAPI dll to work better on IIS 7.0 and 7.5. The ISAPI used to read its configuration from the registry but I wanted to convert that to using the web.config file in the same folder.
It worked fine with CGI but the ISAPI is another matter. I'm using GetModuleFileName
to get the path of the module and, of course, it's giving me back the path of the IIS worker process (C:\Windows\SysWOW64\inetsrv).
Is there a way to get the physical path of the ISAPI dll itself ?
I'm using this function and works great.
function GetDllName: string;
var
pName: PChar;
begin
GetMem(pName, 200);
windows.GetModuleFileName(HInstance, pName, 200);
Result := string(pName);
FreeMem(pName);
end;
这篇关于找出ISAPI dll的物理路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!