Link to home
Create AccountLog in
Avatar of KingSencat
KingSencat

asked on

How to convert a .txt to ascii using Visual Basic v6.0

I have a .txt file which contains non-ascii code like, Y!÷äÝs   P!÷äÕY   6!÷äÎi   ,!÷ä¸   !÷ä²s   !÷ä©y   !÷ä¦$
How do i remove all the strange characters from the .txt and remain the normal ones ? Please help
Avatar of Haris V
Haris V
Flag of India image

check this link ,
1. http://www.devasp.net/net/articles/display/622.html
2.
Imports System.Text
Imports System.IO


Public Class Tester
    Public Shared Sub Main
   
        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()
    End Sub

End Class

3. http://www.vb-helper.com/howto_binary_to_text.html
ASKER CERTIFIED SOLUTION
Avatar of CSecurity
CSecurity
Flag of Iran, Islamic Republic of image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer