找出ISAPI dll的物理路径 [英] Finding out the physical path of an ISAPI dll

查看:331
本文介绍了找出ISAPI dll的物理路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在转换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的物理路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆