Ciao a tutti ho un problema stupidissimo,
vorrei salvare dei dati in file di testo è normale che dopo salvato mi trovo un carattere a caso come prima lettera di ogni riga aprendo il file con gedit?
come lo tolgo??
PUBLIC SUB Button1_Click()
DIM hFile AS File
DIM txtcom AS String
DIM txtdescr AS String
txtcom = Conv(TextArea1.Text, "UTF-8", "ISO-8859-15")
txtdescr = Conv(TextArea2.Text, "UTF-8", "ISO-8859-15")
OPEN "/home/marco/Comandiutili.txt" FOR APPEND AS #hFile
WRITE #hfile, "***********************************" & Chr(10)
WRITE #hfile, CStr(Now) & Chr(10)
WRITE #hfile, "Comando" & "\n"
WRITE #hfile, txtcom & Chr(10)
WRITE #hfile, "Serve per:" & Chr(10)
WRITE #hfile, txtdescr & Chr(10)
CLOSE #hfile
END
..poi perchè se invece di un file uso write su Mysock con un indirizzo email la mail arriva a destinazione e il mio server smtp non mi da errore???
WRITE #MySock, "mail from:<" & TextBox2.Text & ">" & Chr$(13) & Chr$(10), Len("mail from:<" & TextBox2.Text & ">" & Chr$(13) & Chr$(10))
non dovrebbe avere "scritto" anche qui il cattere prima della m di mail from?
vorrei salvare dei dati in file di testo è normale che dopo salvato mi trovo un carattere a caso come prima lettera di ogni riga aprendo il file con gedit?
si anche a me si presentano dei caratteri di troppo, non saprei perchè, se non che gedit apre di default in utf8.
cmq se vuoi puoi utilizzar equesto altro sistema per scrivere su file, che non crea quei caratteri.
DIM txtcom AS String
DIM txtdescr AS String
DIM stringa AS String
stringa = file.Load(User.Home & "/Comandiutili.txt")
txtcom = Conv(TextArea1.Text, "UTF-8", "ISO-8859-15")
txtdescr = Conv(TextArea2.Text, "UTF-8", "ISO-8859-15")
stringa &= "***********************************" & Chr(10)
stringa &= CStr(Now) & Chr(10)
stringa &= "Comando" & "\n"
stringa &= txtcom & Chr(10)
stringa &= "Serve per:" & Chr(10)
stringa &= txtdescr & Chr(10)
File.Save(User.Home & "/Comandiutili.txt", stringa)