Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Database Question and Answers Connect Pin
Pavlex426-Dec-16 7:39
Pavlex426-Dec-16 7:39 
GeneralRe: C# Database Question and Answers Connect Pin
Pete O'Hanlon27-Dec-16 22:24
mvePete O'Hanlon27-Dec-16 22:24 
QuestionC# Read from text file Pin
Pavlex423-Dec-16 21:16
Pavlex423-Dec-16 21:16 
AnswerRe: C# Read from text file Pin
Michael_Davies23-Dec-16 21:29
Michael_Davies23-Dec-16 21:29 
AnswerRe: C# Read from text file Pin
OriginalGriff23-Dec-16 21:34
mveOriginalGriff23-Dec-16 21:34 
GeneralRe: C# Read from text file Pin
Pavlex423-Dec-16 21:40
Pavlex423-Dec-16 21:40 
AnswerRe: C# Read from text file Pin
Midi_Mick23-Dec-16 21:41
professionalMidi_Mick23-Dec-16 21:41 
GeneralRe: C# Read from text file Pin
Pavlex423-Dec-16 21:53
Pavlex423-Dec-16 21:53 
It's working:

C#
List<string> questions = File.ReadLines(path)
                                       .Select(x => x.Split(new char[] { '[', '?' }, StringSplitOptions.RemoveEmptyEntries)[0]).ToList();
            foreach (var x in questions)
            {
                listBox2.Items.Add(x);
            }


How to take separatly: ,2,"Sicilija","Korzika","Sardinija","Kapri"
In first listbox to put answers: 2,1,1,1
In second listbox to put chioce1: Sicilija","travama","Germanik","Japanski običaj" and same for other three choices?

["Koje ostrvo od Italije razdvaja Ligursko more.?",2,"Sicilija","Korzika","Sardinija","Kapri"]
["Agrostologija je nauka o ?",1,"travama","tabletama","konjima","zvezdama"]
["Sin rimskog cara Klaudija i Mesaline zvao se:",2,"Germanik","Britanik","Italik","Hispanik"]
["Šta je ofuro",1,"Japanski običaj","Kineske patike","Otkrivanje","Nemački izraz"]
["Bombardon je:",1,"muzički instrument","veliki top","vrsta aviona","vrsta slatkiša"]
["Koji filozof je rekao \"Sve teče\"?",2,"Pitagora","Heraklit","Aristotel","Sokrat"]
GeneralRe: C# Read from text file Pin
Midi_Mick23-Dec-16 22:09
professionalMidi_Mick23-Dec-16 22:09 
GeneralRe: C# Read from text file Pin
OriginalGriff23-Dec-16 22:56
mveOriginalGriff23-Dec-16 22:56 
GeneralRe: C# Read from text file Pin
Dave Kreskowiak24-Dec-16 4:38
mveDave Kreskowiak24-Dec-16 4:38 
AnswerRe: C# Read from text file Pin
Gerry Schmitz26-Dec-16 5:42
mveGerry Schmitz26-Dec-16 5:42 
QuestionC# Specified cast is not valid Pin
Pavlex422-Dec-16 20:48
Pavlex422-Dec-16 20:48 
AnswerRe: C# Specified cast is not valid Pin
Richard MacCutchan22-Dec-16 21:23
mveRichard MacCutchan22-Dec-16 21:23 
GeneralRe: C# Specified cast is not valid Pin
Pavlex422-Dec-16 21:33
Pavlex422-Dec-16 21:33 
GeneralRe: C# Specified cast is not valid Pin
Richard MacCutchan22-Dec-16 22:09
mveRichard MacCutchan22-Dec-16 22:09 
GeneralRe: C# Specified cast is not valid Pin
harold aptroot22-Dec-16 22:26
harold aptroot22-Dec-16 22:26 
GeneralRe: C# Specified cast is not valid Pin
Richard MacCutchan22-Dec-16 22:33
mveRichard MacCutchan22-Dec-16 22:33 
GeneralRe: C# Specified cast is not valid Pin
harold aptroot22-Dec-16 22:39
harold aptroot22-Dec-16 22:39 
GeneralRe: C# Specified cast is not valid Pin
Richard MacCutchan22-Dec-16 22:54
mveRichard MacCutchan22-Dec-16 22:54 
GeneralRe: C# Specified cast is not valid Pin
OriginalGriff22-Dec-16 22:12
mveOriginalGriff22-Dec-16 22:12 
AnswerRe: C# Specified cast is not valid Pin
OriginalGriff22-Dec-16 22:11
mveOriginalGriff22-Dec-16 22:11 
AnswerRe: C# Specified cast is not valid Pin
Nelson Costa Inácio22-Dec-16 22:42
Nelson Costa Inácio22-Dec-16 22:42 
GeneralRe: C# Specified cast is not valid Pin
harold aptroot22-Dec-16 22:45
harold aptroot22-Dec-16 22:45 
GeneralRe: C# Specified cast is not valid Pin
OriginalGriff23-Dec-16 0:05
mveOriginalGriff23-Dec-16 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.