I am trying to make a program that randomly selects a name. i have a prompt that allows me to enter the number of names and the names themselves. but i dont know how to save or open the information into an array... can anyone help me with this?
ng5
9
Light Poster
Recommended Answers
Jump to PostYou may check out the manual below on how to work with arrays in VB.NET
http://msdn.microsoft.com/en-us/library/wak0wfyt.aspx
Jump to PostTry this link for better understanding array.....
Jump to PostSee if this helps to load.File into Array.
Imports System.IO Public Class Form1 Private myNamesFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "myNamesFile.txt" Private arFileLines() As String = Nothing Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load If File.Exists(myNamesFile) Then arFileLines = File.ReadAllLines(myNamesFile) MsgBox(arFileLines(1)) '// get line.2 …
Jump to PostPrivate Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click myCoolSub() End Sub Private Sub myCoolSub() If File.Exists(myNamesFile) Then arFileLines = File.ReadAllLines(myNamesFile) MsgBox(arFileLines(1)) '// get line.2 from File. End If End Sub
>>how would i write a Private Sub to save the info in the array?
.save to.file? …
All 14 Replies
catherine sea
15
Junior Poster
kingsonprisonic
42
Posting Whiz in Training
ng5
9
Light Poster
codeorder
197
Nearly a Posting Virtuoso
ng5
9
Light Poster
codeorder
commented:
just.because:)
+12
codeorder
197
Nearly a Posting Virtuoso
codeorder
197
Nearly a Posting Virtuoso
ng5
9
Light Poster
ng5
9
Light Poster
codeorder
197
Nearly a Posting Virtuoso
ng5
9
Light Poster
codeorder
197
Nearly a Posting Virtuoso
ng5
9
Light Poster
codeorder
197
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.