question

KorayGen-9730 avatar image
0 Votes"
KorayGen-9730 asked JackJJun-MSFT commented

character problem

Hi

262030-screenshot-3.png



 Dim readLine() As String
         Dim clearLine As New List(Of String)
    
         readLine = IO.File.ReadAllLines(TextBox1.Text)
    
         For Each line As String In readLine
    
             If line.Contains("key =") = False Then
    
                 clearLine.Add(line)
    
             End If
    
         Next
    
         File.WriteAllLines(TextBox1.Text, clearLine)


can i fix this problem

windows-forms
screenshot-3.png (20.9 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@KorayGen-9730, Welcome to Microsoft Q&A, what is your current problem? Do you mean that your new file occurs the different characters with the first file? If so, could you upload your first file so that I could make a test?

0 Votes 0 ·

I solved the problem as follows, but there is another problem :)

 File.WriteAllLines(TextBox1.Text, clearLine,Encoding.Default)

This is an encrypted file
I want to insert code inside an encrypted file and want it to delete the code when decrypted again

I am uploading 2 files, the original and the file I wrote code and want to delete again

I add it to the bottom line of the file with this code

 Dim inputString As String = vbCrLf & "key = " & TextBox1.Text
         My.Computer.FileSystem.WriteAllText(TextBox2.Text,
           inputString, True)



i want this to delete it again
After deleting the code decrypt cannot read file

262384-org.png

262357-edit.png


the problem is it sees each line as a character

No problem when I delete and save manually

262403-orjinaltestencrypt.txt


262335-edittestencrypt.txt


Can you delete txt extensions, I added txt to upload

  1. File name = (orjinal)test.encrypt

  2. File name = (edit)test.encrypt

i hope i could explain (i use google translator)


0 Votes 0 ·
org.png (18.5 KiB)
edit.png (19.0 KiB)

@KorayGen-9730, Thanks for the feedback, could you upload your txt file again? It cannot be downloaded now.

Can you delete txt extensions

You could try to use Path.GetFileNameWithoutExtension Method to remove file name extensions.



0 Votes 0 ·

0 Answers