ive created a function for generating username, password, email to log in on a website but the problem is i want to use all account one at a time for example


log in 1st acct ... do something then logout... then log in 2nd acct... do something then logout.... so on so fort...

heres my code function for generating random...

Public Sub GenerateNames1(ByRef file As String)
        Dim Random As New Random
        Dim RndmResult As Integer
        RndmResult = Random.Next(2, 12)
        'read random line

        Dim Details As String = ReadLine(file, RndmResult)
        Dim DetailsArray() As String = Details.Split("|")
        uname = DetailsArray(1)
        email = DetailsArray(2)
        passwd = DetailsArray(3)
    End Sub

how can i do it one at a time?

thx in advance! :D

>how can i do it one at a time?

Dim s As String() = System.IO.File.ReadAllLines("file.txt")(rndVal).Split("|")

thx for your replay i solve this by creating a function

Public Function CountLinesInFile(ByVal strFilePath As String) As Integer
        Dim lc As Integer = 0
        If Not File.Exists(strFilePath) Then
            MsgBox("File: " & strFilePath & _
             " hasn't been downloaded yet. Preprocessing is being aborted.", _
            MsgBoxStyle.OKOnly, "File Does Not Exist")
        End If
            Dim sr As StreamReader = New StreamReader(strFilePath)
            While Not IsNothing(sr.ReadLine)
                lc += 1
            End While
            MsgBox("File: An error occurred while reading " & strFilePath & _
            ". Preprocessing is being aborted.", MsgBoxStyle.OKOnly, "File Read Error")
            lc = -1
        End Try
        Return lc
    End Function

I'm glad you got it working. Please mark this thread as solved if you have found an answer to your question and good luck.