Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How convert text string to asc text in vb.net2010

Posted on 2011-09-15
4
Medium Priority
?
397 Views
Last Modified: 2012-05-12
eg. a="202020" need to convert to "   "

May I know how to make it, thanks.
0
Comment
Question by:turbot_yu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:guvera
ID: 36547375
Hi,

 Please try the below code.

        Dim strSource As String
        Dim bteEndode() As Byte
        Dim myFileStream As New FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)


        strSource = "asdf"
        bteEndode = Encoding.ASCII.GetBytes(strSource)
 
       
        myFileStream.Write(bteEndode, 0, bteEndode.Length)
 
        myFileStream.Close()

Hope it may helpful to you.

Regards
Guvera
0
 
LVL 8

Assisted Solution

by:guvera
guvera earned 400 total points
ID: 36547378
Also please find the below link for more details about this query.

 http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx

Regards
Guvera
0
 
LVL 2

Accepted Solution

by:
ASP8MBM earned 1600 total points
ID: 36547427
hope this helps:

        Dim arrByte As Byte() = Encoding.ASCII.GetBytes(TextBox1.Text)
        Dim strSB As New StringBuilder

        For Each bite As Byte In arrByte
            strSB.Append(bite & " "c)
        Next
        TextBox2.Text = strSB.ToString
0
 

Author Comment

by:turbot_yu
ID: 36547485
it is now already convert to "533132333435363741202020" in string(by Hex(abNum(i))), I need to convert it back to "abc.....".
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question