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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Convert string in byte array

Convert string in byte array

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdata-structuresperformance
5 Posts 5 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.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi, I have an asp.net application, I have some text (or string) which I want to convert in to byte array. which is the best performance oriented approach. Please give me your advice or any link would be greatly helpfull. Thanks in advance.

    Thanks & Regards, Abdul Aleem Mohammad St Louis MO - USA

    L 1 Reply Last reply
    0
    • I indian143

      Hi, I have an asp.net application, I have some text (or string) which I want to convert in to byte array. which is the best performance oriented approach. Please give me your advice or any link would be greatly helpfull. Thanks in advance.

      Thanks & Regards, Abdul Aleem Mohammad St Louis MO - USA

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

      indian143 wrote:

      I want to convert in to byte array

      GetBytes(yourString);

      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012

      R V 2 Replies Last reply
      0
      • L Lost User

        indian143 wrote:

        I want to convert in to byte array

        GetBytes(yourString);

        Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012

        R Offline
        R Offline
        Reza Ahmadi
        wrote on last edited by
        #3

        And where are the implementation of GetBytes?? :^)

        C 1 Reply Last reply
        0
        • R Reza Ahmadi

          And where are the implementation of GetBytes?? :^)

          C Offline
          C Offline
          cpkilekofp
          wrote on last edited by
          #4

          System.Text.Encoding.GetBytes()

          "It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown

          1 Reply Last reply
          0
          • L Lost User

            indian143 wrote:

            I want to convert in to byte array

            GetBytes(yourString);

            Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012

            V Offline
            V Offline
            vvashishta
            wrote on last edited by
            #5

            System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding(); Byte[] bytes = encoding.GetBytes(yourString);

            - Happy Coding - Vishal Vashishta

            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