Converting to Hex

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cdude

    Converting to Hex

    I am receiving data from a machine though a Ethernet port.But when C#
    pulls the data in it reads the data as decimal not hexadecimal.How can
    i pull the data as a hex and not as a decimal?please any suggestions.
  • suresh shenoy

    #2
    Re: Converting to Hex

    On Feb 18, 9:12 am, Cdude <camelj...@yaho o.comwrote:
    I am receiving data from a machine though a Ethernet port.But when C#
    pulls the data in it reads the data as decimal not hexadecimal.How can
    i pull the data as a hex and not as a decimal?please any suggestions.
    The data is stored in binary and is represented by the IDE as decimal
    or hex. You need to change the setting to view the data in hex.


    Suresh M. Shenoy

    Comment

    • Cdude

      #3
      Re: Converting to Hex

      On Feb 18, 4:25 pm, suresh shenoy <msureshshe...@ gmail.comwrote:
      On Feb 18, 9:12 am, Cdude <camelj...@yaho o.comwrote:
      >
      I am receiving data from a machine though a Ethernet port.But when C#
      pulls the data in it reads the data as decimal not hexadecimal.How can
      i pull the data as a hex and not as a decimal?please any suggestions.
      >
      The data is stored in binary and is represented by the IDE as decimal
      or hex. You need to change the setting to view the data in hex.
      >
      Suresh M. Shenoy
      How do i do this?

      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: Converting to Hex

        On Feb 18, 2:12 pm, Cdude <camelj...@yaho o.comwrote:
        I am receiving data from a machine though a Ethernet port.But when C#
        pulls the data in it reads the data as decimal not hexadecimal.How can
        i pull the data as a hex and not as a decimal?please any suggestions.
        What exactly do you mean by "reads the data as decimal not
        hexadecimal"? Bear in mind that as far as the computer is concerned
        it's just numbers (bits, even). Numbers themselves aren't inherently
        decimal or hex - they're just numbers. How you format the numbers is
        up to you.

        Now, presumably you are seeing a decimal representation somewhere that
        you want to see hex. Where is that?

        Jon

        Comment

        • Cdude

          #5
          Re: Converting to Hex

          On Feb 18, 4:30 pm, "Jon Skeet [C# MVP]" <sk...@pobox.co mwrote:
          On Feb 18, 2:12 pm, Cdude <camelj...@yaho o.comwrote:
          >
          I am receiving data from a machine though a Ethernet port.But when C#
          pulls the data in it reads the data as decimal not hexadecimal.How can
          i pull the data as a hex and not as a decimal?please any suggestions.
          >
          What exactly do you mean by "reads the data as decimal not
          hexadecimal"? Bear in mind that as far as the computer is concerned
          it's just numbers (bits, even). Numbers themselves aren't inherently
          decimal or hex - they're just numbers. How you format the numbers is
          up to you.
          >
          Now, presumably you are seeing a decimal representation somewhere that
          you want to see hex. Where is that?
          >
          Jon
          Okay seem to of managed to get it right

          Comment

          Working...