scorpion555 Posted June 11, 2003 Posted June 11, 2003 hello I need to display different things (either radio or check boxes) on a form (I need to do a survey) from a file, but i also need to display the answers from the same text file, can I do this with stream reader??? (in other words can set some lines to a variable)if so how would the syntax be??:) :) (the book I have doesnt have any instructions on how to do this) text file: radio buttons pizza, tacos, burgers, salads (pizza, tacos, burgers, salads are the answers on the survey) Ineed to do this because the user can't program, so they only need to modify the text file without programming Any suggestions, comments, or any better way to go around this??? Thanks in advance:D :D Quote
*Experts* mutant Posted June 11, 2003 *Experts* Posted June 11, 2003 Im not sure what you mean :) You want to read a file, create a radio button for every option, and the check if the correct one was checked? Quote
scorpion555 Posted June 12, 2003 Author Posted June 12, 2003 well the professor wants a program where he can modify the text so the program will run according to his instructions, however hes a psyc prof. so he can't program. The text file will say what kind of questions it is (radio buttons or check boxes). Thats the part I am worried about, how can I check the text file in order to set the check box or radio button visible? I know just found out about the input function, i'll play around with that,till then I don't know how to go around it. Thanks :D Quote
*Experts* mutant Posted June 12, 2003 *Experts* Posted June 12, 2003 I think an XML file would be great for this kind of thing. Its a lot easier to navigate than normal files. Im still not sure about the rest becuase you didnt answer my question :). Quote
scorpion555 Posted June 16, 2003 Author Posted June 16, 2003 Sorry for not making my self clear I do want to read a file, create a radio button for every option, and the write to another file which button was chosen, i got the program to read from the file so i can display the question and answers, but i am only able to read the first question, still working on that..... about the suggestion, yes it could problably be done in other ways, xml would problably be the best one, but for some reason they just wanted a standalone program. (it would have made my job easier) Quote
*Experts* mutant Posted June 16, 2003 *Experts* Posted June 16, 2003 How does the file with questions look? When using XML in .NET you dont need anything else except framework itself. Quote
Faceless Master Posted June 22, 2003 Posted June 22, 2003 Sorry for not making my self clear I do want to read a file, create a radio button for every option, and the write to another file which button was chosen, i got the program to read from the file so i can display the question and answers, but i am only able to read the first question, still working on that..... about the suggestion, yes it could problably be done in other ways, xml would problably be the best one, but for some reason they just wanted a standalone program. (it would have made my job easier) ------------------------------------------------ Here is the code to Read From File Dim TestFile As FileStream = New FileStream _ ("C:\test.txt", FileMode.Open) Dim FileReader As StreamReader = New StreamReader(TestFile) TextBox1.Text = FileReader.ReadToEnd TestFile.Close() FileReader.Close() Quote Creativity Beyond Imagination http://www.facelessmaster.tk
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.