Announcement

Collapse
No announcement yet.

VB to C#

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

    VB to C#

    I want to move a very simple piece of code from VB to C#. I found numerous samples in the forum but all failed with different errors.

    This is the code:

    Sub Main(Parm As Object)
    Dim DE, dv
    'Get a list of devices
    DE = hs.GetDeviceEnumerator
    If DE is nothing then
    hs.Writelog("Info", "No thermostats")
    end if

    Do while Not DE.Finished
    dv = DE.GetNext ' DV is van het type DeviceClass en bevast alle informatie over het device
    hs.Writelog("Interface", dv.Interface(hs))
    Loop
    End Sub

    Can someone help me to put this into a working C# script (maybe including 'using' statements).

    Thanks in advance!

    Kees


    Current Date/Time: 03-Oct-17 4:57:13 PM
    HomeSeer Version: HS3 Pro Edition 3.0.0.362
    Operating System: Microsoft Windows 10 Enterprise 2015 LTSB - Work Station
    System Uptime: 13 Days 10 Hours 10 Minutes 44 Seconds
    IP Address: 192.168.253.161
    Number of Devices: 362
    Number of Events: 83
    Available Threads: 400

    Enabled Plug-Ins
    2.0.35.0: BLLAN
    3.0.0.10: P1
    30.0.0.35: RFXCOM
    1.0.0.6: Sample Plugin
    1.2.2.0: SceneMaster
    3.0.0.21: Sonos
    3.0.1.144: Z-Wave

    #2
    You might get more visibility for your question if you post it in the scripting forum.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Other forum branch

      Hi Michael,

      Thanks for the suggestion, but I did n't poost there as it is a sub branch of Developer Support > Scripts & Plug-Insevelopment and Libraries

      This is purely on the user level and totalky not PI related, so I felt that forum was for more technical questions.

      But from your comments I take it is also for simple front-end scripts. Reported there.

      Comment


        #4
        In my experience, posts on almost any relevant topic are welcome in any of the forums and 'basic' questions are just as important as technically sophisticated ones. I also think your question is likely to be seen by someone who can answer it authoritatively if you post it in a forum where those topics are routinely discussed.
        Mike____________________________________________________________ __________________
        HS3 Pro Edition 3.0.0.548, NUC i3

        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

        Comment

        Working...
        X