Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Connect to network equipment

Connect to network equipment

Scheduled Pinned Locked Moved C#
questioncsharpsysadminsecurity
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    grmihel2
    wrote on last edited by
    #1

    Hi guys, I have search the web for how I can make some C# code, that connect to some network equipment (such as a switch). I have read about sockets and TcpClient. Normally I connect my network switches through Telnet (TCP port 23), and sending the switch telnet commands there. I want my own C# app to make this command call to a given switch, with a single click from the user on a buttom. How can I make a connection to a network switch with C# code? there is username and password for security on the switches, so I have to pass them too somehow in the connection session... Any suggestions? Sockets or tcpClient?

    L 1 Reply Last reply
    0
    • G grmihel2

      Hi guys, I have search the web for how I can make some C# code, that connect to some network equipment (such as a switch). I have read about sockets and TcpClient. Normally I connect my network switches through Telnet (TCP port 23), and sending the switch telnet commands there. I want my own C# app to make this command call to a given switch, with a single click from the user on a buttom. How can I make a connection to a network switch with C# code? there is username and password for security on the switches, so I have to pass them too somehow in the connection session... Any suggestions? Sockets or tcpClient?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx[^]

      G 1 Reply Last reply
      0
      • L Lost User

        http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx[^]

        G Offline
        G Offline
        grmihel2
        wrote on last edited by
        #3

        That example is with TcpClient, it may work too. But I actually managed to get a simpel 'ena swi po=x' telnet command working through Socket connection to the switch. I don't know is there is any of them that are pref from another?

        L 1 Reply Last reply
        0
        • G grmihel2

          That example is with TcpClient, it may work too. But I actually managed to get a simpel 'ena swi po=x' telnet command working through Socket connection to the switch. I don't know is there is any of them that are pref from another?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Telnet is TCP Port 23, then use TcpClient. I prefer using TcpClient than Socket.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups