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. Storing memory address as hex in an xml file

Storing memory address as hex in an xml file

Scheduled Pinned Locked Moved C#
csharpxmlperformancequestion
9 Posts 7 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.
  • J Offline
    J Offline
    Jordanwb
    wrote on last edited by
    #1

    Basically what I want to do is store a memory address in hex format instead of decimal in an XmlAttribute value. Can I do that? This is how I want the xml to look:

    <address name="type" value="0x16694E64" />

    instead of:

    <address name="type" value="376000100" />

    Then in C# I have this:

    int myAddress = Convert.ToInt32 (address.Attributes["value"].Value);

    C P 2 Replies Last reply
    0
    • J Jordanwb

      Basically what I want to do is store a memory address in hex format instead of decimal in an XmlAttribute value. Can I do that? This is how I want the xml to look:

      <address name="type" value="0x16694E64" />

      instead of:

      <address name="type" value="376000100" />

      Then in C# I have this:

      int myAddress = Convert.ToInt32 (address.Attributes["value"].Value);

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      That's an int. An int has no format at all, decimal is just assumed. Use the overloaded ToString method to specify a hex format, or whatever else you like

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      J 1 Reply Last reply
      0
      • C Christian Graus

        That's an int. An int has no format at all, decimal is just assumed. Use the overloaded ToString method to specify a hex format, or whatever else you like

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        J Offline
        J Offline
        Jordanwb
        wrote on last edited by
        #3

        I don't want to save the address to XML via C#, I want to read the address from the XML. Sorry I wasn't specific enough.

        1 Reply Last reply
        0
        • J Jordanwb

          Basically what I want to do is store a memory address in hex format instead of decimal in an XmlAttribute value. Can I do that? This is how I want the xml to look:

          <address name="type" value="0x16694E64" />

          instead of:

          <address name="type" value="376000100" />

          Then in C# I have this:

          int myAddress = Convert.ToInt32 (address.Attributes["value"].Value);

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Have a look at this[^].

          U 1 Reply Last reply
          0
          • P PIEBALDconsult

            Have a look at this[^].

            U Offline
            U Offline
            User 6623435
            wrote on last edited by
            #5

            riving license (class) +number: string (constructor) +renewelperiod: int (constructor) + GetLicenseInfo():void (mrthod) + CalculateLicensePrice(): double (method) + DisplayLicenseInfo() : void (method) Based on the above, create a program with the following requirement • GetLicenseInfo() method that input license number and renewal period from user. Display an information to the user either to renew the license for 1,2,3 or 5 years. • CalculateLicensePrice() method that will calculate price for driving license depends on the renewal period of 1,2,3 or 5 years. The renewal fee is RM30 per year • A method DisplayLicenseInfo() that will display each details including license number,renewal period and license price. Create an object and invoke necessary method

            N C L P 4 Replies Last reply
            0
            • U User 6623435

              riving license (class) +number: string (constructor) +renewelperiod: int (constructor) + GetLicenseInfo():void (mrthod) + CalculateLicensePrice(): double (method) + DisplayLicenseInfo() : void (method) Based on the above, create a program with the following requirement • GetLicenseInfo() method that input license number and renewal period from user. Display an information to the user either to renew the license for 1,2,3 or 5 years. • CalculateLicensePrice() method that will calculate price for driving license depends on the renewal period of 1,2,3 or 5 years. The renewal fee is RM30 per year • A method DisplayLicenseInfo() that will display each details including license number,renewal period and license price. Create an object and invoke necessary method

              N Offline
              N Offline
              nagendrathecoder
              wrote on last edited by
              #6

              what are you doing man? X|

              1 Reply Last reply
              0
              • U User 6623435

                riving license (class) +number: string (constructor) +renewelperiod: int (constructor) + GetLicenseInfo():void (mrthod) + CalculateLicensePrice(): double (method) + DisplayLicenseInfo() : void (method) Based on the above, create a program with the following requirement • GetLicenseInfo() method that input license number and renewal period from user. Display an information to the user either to renew the license for 1,2,3 or 5 years. • CalculateLicensePrice() method that will calculate price for driving license depends on the renewal period of 1,2,3 or 5 years. The renewal fee is RM30 per year • A method DisplayLicenseInfo() that will display each details including license number,renewal period and license price. Create an object and invoke necessary method

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                Just because someone helped a person who asked a specific question, doesn't mean he'll do your homework. Imagine what this forum would look like if every person with a question started to hijack threads ?

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                1 Reply Last reply
                0
                • U User 6623435

                  riving license (class) +number: string (constructor) +renewelperiod: int (constructor) + GetLicenseInfo():void (mrthod) + CalculateLicensePrice(): double (method) + DisplayLicenseInfo() : void (method) Based on the above, create a program with the following requirement • GetLicenseInfo() method that input license number and renewal period from user. Display an information to the user either to renew the license for 1,2,3 or 5 years. • CalculateLicensePrice() method that will calculate price for driving license depends on the renewal period of 1,2,3 or 5 years. The renewal fee is RM30 per year • A method DisplayLicenseInfo() that will display each details including license number,renewal period and license price. Create an object and invoke necessary method

                  L Offline
                  L Offline
                  Lutoslaw
                  wrote on last edited by
                  #8

                  I am afraid that you have misunderstood Christian's suggestion in your previous post. You are supposed to ask a specific question, not somebody else... :doh:

                  Greetings - Jacek

                  1 Reply Last reply
                  0
                  • U User 6623435

                    riving license (class) +number: string (constructor) +renewelperiod: int (constructor) + GetLicenseInfo():void (mrthod) + CalculateLicensePrice(): double (method) + DisplayLicenseInfo() : void (method) Based on the above, create a program with the following requirement • GetLicenseInfo() method that input license number and renewal period from user. Display an information to the user either to renew the license for 1,2,3 or 5 years. • CalculateLicensePrice() method that will calculate price for driving license depends on the renewal period of 1,2,3 or 5 years. The renewal fee is RM30 per year • A method DisplayLicenseInfo() that will display each details including license number,renewal period and license price. Create an object and invoke necessary method

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    Ignore the others - I'll help you. Of course, you'll have to pay the daily rates my company charges, but what the hell - we'll throw in a years support contract for a very reasonable fee. We will expect an initial payment before work commences, but once we have the contract in place, we'll be good to go.

                    "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                    As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                    My blog | My articles | MoXAML PowerToys | Onyx

                    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