Finding out the physical path of an ISAPI dll

青春壹個敷衍的年華 提交于 2019-12-21 02:13:08

问题


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 ?


回答1:


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;


来源:https://stackoverflow.com/questions/4041492/finding-out-the-physical-path-of-an-isapi-dll

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!