Announcement

Collapse
No announcement yet.

.asp page to display all devices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • jon00
    replied
    GetDeviceEnumerator works fine...just not an asp web page.

    This works using an .aspx page:

    Code:
    <%@ Page Language="VB" %>
    <script runat="server">
    Public hs As Scheduler.hsapplication
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    hs = Context.Items("Content")
    
    Dim EN As Scheduler.Classes.clsDeviceEnumeration
    Dim dv As Scheduler.Classes.DeviceClass
    
    EN = hs.GetDeviceEnumerator
    
    If EN Is Nothing Then
        response.write ("Error getting Enumerator")
        response.end()
    End If
    
    do
        dv = EN.GetNext
        If dv Is Nothing Then exit Do
        response.write (dv.name(Nothing) & "<br>")
    
    loop
    
    response.write ("Finished")
    
    End Sub
    
    </script>

    Leave a comment:


  • jwshome2
    started a topic .asp page to display all devices

    .asp page to display all devices

    In HS3 I was able to use the following code to list all my devices on an .asp page:

    Code:
    <%
    
    set EN = hs.GetDeviceEnumerator
    If EN Is Nothing Then
        response.write "Error getting Enumerator"
        response.end
    End If
    
    do
        set dv = EN.GetNext
        If dv Is Nothing Then exit Do
        response.write dv.name(Nothing) & "<br>"
    
    loop
    
    response.write "Finished"
    
    %>
    When I display this web page in HS4 I get the following error:

    Script error: Object required: 'EN'
    set dv = EN.GetNext
    If dv Is Nothing Then exit Do
    Some posts on the forum suggest that GetDeviceEnumerator has been eliminated in HS4; others say it still works. A few posts refer to a method called 'GetAllRefs' but I can't find any documentation other than what's written on Github, which to me is indecipherable.

    Can someone help me to get this simple code working on an .asp page? Thanks in advance for any advice ...
Working...
X