Guest User

Untitled

a guest
Jul 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. from isapi import isapicon, threaded_extension
  2. import sys
  3. import traceback
  4. try:
  5. from urllib import urlopen
  6. except ImportError:
  7. # py3k spelling...
  8. from urllib.request import urlopen
  9. import win32api
  10.  
  11. # sys.isapidllhandle will exist when we are loaded by the IIS framework.
  12. # In this case we redirect our output to the win32traceutil collector.
  13. if hasattr(sys, "isapidllhandle"):
  14. import win32traceutil
  15. from random import random
  16. # The ISAPI extension - handles all requests in the site.
  17. class Extension(threaded_extension.ThreadPoolExtension):
  18. "Python sample Extension"
  19. def Dispatch(self, ecb):
  20. headers = """Content-Type: text/html\n\n"""
  21. ecb.SendResponseHeaders("200 OK", headers, False)
  22. ecb.WriteClient('HW from Extension Only %s' % random())
  23. ecb.DoneWithSession()
  24. return isapicon.HSE_STATUS_SUCCESS
  25.  
  26. # The entry points for the ISAPI extension.
  27. def __ExtensionFactory__():
  28. return Extension()
Add Comment
Please, Sign In to add comment