Results 1 to 3 of 3

Thread: [RESOLVED] Split texts files

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    256

    Resolved [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?
    Last edited by lelejau; Jan 2nd, 2010 at 09:03 PM.






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width