I have this script here:
Imports system.IO
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Step1.Click
If File.Exists("sayings.txt") Then
Dim ioFile As New StreamReader("sayings.txt")
Dim ioLine As String
Dim ioLines As String
ioLine = ioFile.ReadLine
ioLines = ioLine
While Not ioLine = ""
ioLine = ioFile.ReadLine
ioLines = ioLines & vbCrLf & ioLine
End While
RichTextBox1.AppendText(ioLines)
ioFile.Close()
Else
Dim ioFile As New StreamWriter("sayings.txt")
ioFile.WriteLine("Chinese words here")
ioFile.WriteLine("Chinese words here")
ioFile.WriteLine("Chinese words here")
ioFile.Close()
End If
End Sub
What it does is reads from file sayings.txt and when I press Button1 it copies everything from sayings.txt into a richtextbox.
now the problem is that I don't want everything, I just want one random line.
Any help getting it to do this is appreciated.
-Terra

New Topic/Question
Reply




MultiQuote




|