Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from isapi import isapicon, threaded_extension
- import sys
- import traceback
- try:
- from urllib import urlopen
- except ImportError:
- # py3k spelling...
- from urllib.request import urlopen
- import win32api
- # sys.isapidllhandle will exist when we are loaded by the IIS framework.
- # In this case we redirect our output to the win32traceutil collector.
- if hasattr(sys, "isapidllhandle"):
- import win32traceutil
- from random import random
- # The ISAPI extension - handles all requests in the site.
- class Extension(threaded_extension.ThreadPoolExtension):
- "Python sample Extension"
- def Dispatch(self, ecb):
- headers = """Content-Type: text/html\n\n"""
- ecb.SendResponseHeaders("200 OK", headers, False)
- ecb.WriteClient('HW from Extension Only %s' % random())
- ecb.DoneWithSession()
- return isapicon.HSE_STATUS_SUCCESS
- # The entry points for the ISAPI extension.
- def __ExtensionFactory__():
- return Extension()
Add Comment
Please, Sign In to add comment