[RESOLVED] Split texts files
Well, i have to translate this vb6 code:
Code:
ff = FreeFile
Open App.Path & "\UpdateArcadePT\ListaUpdate.dat" For Binary As #ff
URL = Space$(LOF(ff))
Get #ff, , URL
Close #ff
If URL = "" Then
Unload Me
Else
strLines = Split(URL, vbNewLine)
For i = LBound(strLines) To UBound(strLines)
If Len(strLines(i)) > 0 Then
strParts = Split(strLines(i), ";")
File.Caption = "Downloading " & strParts(1)
......
To C#, i have made this so far:
Code:
StreamReader objReader = new StreamReader(Environment.CurrentDirectory + @"\update\files.dat");
string sLine = objReader.ReadToEnd();
objReader.Close();
string[] pedacos = sLine.Split('\n');
for (Int32 i = 0; i < pedacos.Count(); i++)
{
string[] partes = pedacos.ToString().Split(new char[] {';'});
MessageBox.Show(partes.ToString());
}
The txt files is in the format:
1;name.rar;http://somesite
2;name2.rar;http://somesite
But the messagebox is returnig: System.String[].
Any help? :wave: