Results 1 to 10 of 10

Thread: [HELP] My random code in text file need a little adjustment!

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    96

    Exclamation [HELP] My random code in text file need a little adjustment!

    Hello! glad to talk with you again! you are very effective! !
    ok i have a little problem with a code!
    indeed, my code generate a random file but sometimes i have no file,error or a blank in a mediaplayer or other stuff!
    here is my code:
    Code:
     
                    Dim Randomtaunt As New Random()
                    Dim Tra As IO.TextReader = System.IO.File.OpenText(Application.StartupPath & "\movies\TAUNTVICTORY\" & Me.Label23.Text & ".txt")
                    Dim FileLinest() As String = Split(Tra.ReadToEnd(), vbCrLf)
                    Tra.Close()
                    Dim MyTAUNT As String = FileLinest(Randomtaunt.Next(0, UBound(FileLinest)))
                    Me.AxWindowsMediaPlayer5.URL = Application.StartupPath & "\movies\TAUNTVICTORY\" & MyTAUNT
                    Me.AxWindowsMediaPlayer5.settings.setMode("loop", False)
                    Me.AxWindowsMediaPlayer5.Ctlcontrols.play()
    i suspect when the computer read my text file it could read a blank line. how must we fix it?

    thank you in advance for your answer!
    Last edited by danzey; Jul 4th, 2020 at 06:48 PM.

Tags for this Thread

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