Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27379

VS 2010 Random Line from Text file to String

$
0
0
Alright so I've googled for a couple hours trying to find this and I can't seem to get exactly what I'm looking for. For this example, I'm trying to display a random picture.

I have a text file that I have imported into the local resources. The text file has 10 URLs of different pictures. Each on a different line. When the form loads, I want it to randomly pick out one of the URLs from the text file. (I can generate a random number if necessary.) Once it's picked one of the URLs, I need it to be assigned to a string. Then I will use the string to display the picture etc.

Any help is greatly appreciated!


Hunter

Viewing all articles
Browse latest Browse all 27379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>