DexterSK_ 0 Odesláno: 29. Říjen, 2013 Share Odesláno: 29. Říjen, 2013 Ahoj, chcel by som sa opýtať ako môžem vytiahnuť text zo súboru podľa riadkov, skúšal som to takto ale hneď po spustení mi to crashlo string subor = @"udaje.dat"; string[] lines = File.ReadAllLines(subor); string id = lines[1]; string heslo = lines[2]; Link to comment Share on other sites More sharing options...
0 Albus Brambůrek 41 Odesláno: 30. Říjen, 2013 Share Odesláno: 30. Říjen, 2013 No určitě vím jedno máš to blbě Zkus oddělat @ Možná ti to pomůže : http://msdn.microsoft.com/en-us/library/vstudio/ezwyzy7b.aspx Poprípadě toto : http://msdn.microsoft.com/en-us/library/db5x7c0d.aspx Link to comment Share on other sites More sharing options...
0 Robin 67 Odesláno: 30. Říjen, 2013 Share Odesláno: 30. Říjen, 2013 Je to napísane dobre. Btw ta @ je tam zbytočne keď v tej ceste nemáš / , Ak máš v súbore len 2 riadky tak ti chybu háďze za to. Start index v tom lines[] začína od 0 čiže lines[0] je riadok 1, lines[1] riadok 2 Link to comment Share on other sites More sharing options...
0 Cloudy 0 Odesláno: 7. Prosinec, 2013 Share Odesláno: 7. Prosinec, 2013 Zkus si to kdyžtak kontrolovat přes lines.Length if (lines.Length<2) {return;} Link to comment Share on other sites More sharing options...
Dotaz
DexterSK_ 0
Ahoj, chcel by som sa opýtať ako môžem vytiahnuť text zo súboru podľa riadkov, skúšal som to takto ale hneď po spustení mi to crashlo
string subor = @"udaje.dat";
Link to comment
Share on other sites
3 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now