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. Network Programing

Network Programing

Scheduled Pinned Locked Moved C#
helpcsharpsysadmintutorial
6 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.
  • M Offline
    M Offline
    Menhal
    wrote on last edited by
    #1

    Greetings for all, I have a problem with connecting to a BXR-5000 router through Telnet using C#. I used the following code to connect successfully to Cisco routers without any problem: -------------------------------------------------------------------------------------------- IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(ipAddress), port); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(remoteEP); NetworkStream stream = new NetworkStream(socket); StreamReader reader = new StreamReader(stream); StreamWriter writer = new StreamWriter(stream); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); -------------------------------------------------------------------------------------------- But, when connecting to a BXR router, the character ‘%’ is returned and I can not read or write any thing. Could you please help me. I am about to finish my project but this problem stoped me and I do not know how to deal with. Thanks in deep... Menhal

    K 1 Reply Last reply
    0
    • M Menhal

      Greetings for all, I have a problem with connecting to a BXR-5000 router through Telnet using C#. I used the following code to connect successfully to Cisco routers without any problem: -------------------------------------------------------------------------------------------- IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(ipAddress), port); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.Connect(remoteEP); NetworkStream stream = new NetworkStream(socket); StreamReader reader = new StreamReader(stream); StreamWriter writer = new StreamWriter(stream); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); Console.WriteLine(writer.read().ToString()); -------------------------------------------------------------------------------------------- But, when connecting to a BXR router, the character ‘%’ is returned and I can not read or write any thing. Could you please help me. I am about to finish my project but this problem stoped me and I do not know how to deal with. Thanks in deep... Menhal

      K Offline
      K Offline
      Koltz
      wrote on last edited by
      #2

      may you show telnet screen of your connection to BXR-5000 ?

      M 1 Reply Last reply
      0
      • K Koltz

        may you show telnet screen of your connection to BXR-5000 ?

        M Offline
        M Offline
        Menhal
        wrote on last edited by
        #3

        Here is what you asked for: http://www.2shared.com/download/2461789/a450daf4/1\_online.GIF?tsid=20071104-234241-13ded5b3 http://www.2shared.com/download/2461798/ca4cdb23/2\_online.GIF?tsid=20071104-234811-3de5a56d http://www.2shared.com/download/2461800/1e09af65/3\_online.GIF?tsid=20071104-234912-843fd538 Thanks...

        K 1 Reply Last reply
        0
        • M Menhal

          Here is what you asked for: http://www.2shared.com/download/2461789/a450daf4/1\_online.GIF?tsid=20071104-234241-13ded5b3 http://www.2shared.com/download/2461798/ca4cdb23/2\_online.GIF?tsid=20071104-234811-3de5a56d http://www.2shared.com/download/2461800/1e09af65/3\_online.GIF?tsid=20071104-234912-843fd538 Thanks...

          K Offline
          K Offline
          Koltz
          wrote on last edited by
          #4

          The quality is bad, so I do not see anything from links, try do experiments with \n && \r\n

          M 1 Reply Last reply
          0
          • K Koltz

            The quality is bad, so I do not see anything from links, try do experiments with \n && \r\n

            M Offline
            M Offline
            Menhal
            wrote on last edited by
            #5

            Sorry for links. It is just returning the number 37 that corresponds to '%'.

            K 1 Reply Last reply
            0
            • M Menhal

              Sorry for links. It is just returning the number 37 that corresponds to '%'.

              K Offline
              K Offline
              Koltz
              wrote on last edited by
              #6

              if you have software witch can communicate with your device (via telnet or http) you can get all sended and received data via sniffers.

              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