caps.asp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <%@ Language=Python %>
  2. <HTML>
  3. <HEAD>
  4. <BODY BACKGROUND="/samples/images/backgrnd.gif">
  5. <TITLE>Python test</TITLE>
  6. </HEAD>
  7. <BODY BGCOLOR="FFFFFF">
  8. <SCRIPT Language="Python" RUNAT=Server>
  9. # NOTE that the <% tags below execute _before_ these tags!
  10. Response.Write("Hello from Python<P>")
  11. Response.Write("Browser is "+bc.browser)
  12. import win32api # Should be no problem using win32api in ASP pages.
  13. Response.Write("<p>Win32 username is "+win32api.GetUserName())
  14. </SCRIPT>
  15. <BODY BGCOLOR="FFFFFF">
  16. <%
  17. import sys
  18. print sys.path
  19. from win32com.axscript.asputil import *
  20. print "Hello"
  21. print "There"
  22. print "How are you"
  23. %>
  24. <%bc = Server.CreateObject("MSWC.BrowserType")%>
  25. <BODY BGCOLOR="FFFFFF">
  26. <table border=1>
  27. <tr><td>Browser</td><td> <%=bc.browser %>
  28. <tr><td>Version</td><td> <%=bc.version %> </td></TR>
  29. <tr><td>Frames</td><td>
  30. <%Response.Write( iif(bc.frames, "TRUE", "FALSE")) %></td></TR>
  31. <tr><td>Tables</td><td>
  32. <%Response.Write( iif (bc.tables, "TRUE", "FALSE")) %></td></TR>
  33. <tr><td>BackgroundSounds</td><td>
  34. <%Response.Write( iif(bc.BackgroundSounds, "TRUE", "FALSE"))%></td></TR>
  35. <tr><td>VBScript</td><td>
  36. <%Response.Write( iif(bc.vbscript, "TRUE", "FALSE"))%></td></TR>
  37. <tr><td>JavaScript</td><td>
  38. <%Response.Write( iif(bc.javascript, "TRUE", "FALSE"))%></td></TR>
  39. </table>
  40. </body>
  41. </html>