如何在window2000下调试isapi[masterz的专栏]

来源:互联网 发布:怎么在淘宝买刀具 编辑:程序博客网 时间:2024/06/08 06:32
先把isapi放在有可执行权限的目录下,在IE中访问这个dll,如果是下载而不是看到执行的结果,那是你没有设定这个目录可执行权限,把Execute Permissions设为Scripts and Executables就可以执行ISAPI了 ,
例如设wwwroot的可执行属性:
在administrativetools中打开Internet Information Services, 打开Default Web Site的propertypage,在Home Directory tab上,有一个ExecutePermissions:,它右边的combobox一般缺省为Script only,改为Scripts andExecutables就可以执行ISAPI了

如果找不到这个url那是你的www 服务没有开。在ISAPI的代码中输出当前进程号{char buf[128]; sprintf(buf, "ISAPI running inprocess %d", GetCurrentProcessId());OutputDebugString(buf);}以便调试(Attach toProcess)。OutputDebugString的输出可以用dbgview.exe看到。
可以在IE中看到isapi的结果后,打开win2000的任务列表,选中isapi所在的进程,mouse右键菜单选择debug,会调出vc6.0, 在这个
VC的project菜单setting ->Debug tab, Category选成Additional dlls,在下面的列表中添上你的isapi, 然后在这个vc中打开你的isapi source文件,在文件中设break point, refreshIE, 断点就生效啦....

如果要重新编译isapi, 会报错说文件正在使用,不能更新,可以在dos 控制台窗口运行
net stop w3svc( 作用是停止www 服务) 这时就可以更新isapi了
编译好后再执行 net start w3svc 来启动www 服务。

或者
用以下方式停止www 服务:
在IIS中停止Default  Web site
在Service(Administrative tools->Service)中停止IIS Admin Service ,  World Wide Web Publishing service.
用以下方式启动www 服务:
在Service(Administrative tools->Service)中start IIS Admin Service ,  World Wide Web Publishing service.
在IIS中start Default  Web site 
原创粉丝点击