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

C#

 
GeneralRe: Encrypted Connection Pin
harold aptroot25-Jun-09 4:35
harold aptroot25-Jun-09 4:35 
AnswerRe: Encrypted Connection Pin
Mycroft Holmes24-Jun-09 19:24
professionalMycroft Holmes24-Jun-09 19:24 
QuestionProblem with String.Split() Pin
2TammyB24-Jun-09 8:13
2TammyB24-Jun-09 8:13 
AnswerRe: Problem with String.Split() Pin
led mike24-Jun-09 8:28
led mike24-Jun-09 8:28 
AnswerRe: Problem with String.Split() Pin
Fadi Yoosuf24-Jun-09 8:28
Fadi Yoosuf24-Jun-09 8:28 
AnswerRe: Problem with String.Split() Pin
Henry Minute24-Jun-09 8:34
Henry Minute24-Jun-09 8:34 
GeneralRe: Problem with String.Split() Pin
PIEBALDconsult24-Jun-09 9:29
mvePIEBALDconsult24-Jun-09 9:29 
AnswerRe: Problem with String.Split() Pin
Anthony Mushrow24-Jun-09 8:44
professionalAnthony Mushrow24-Jun-09 8:44 
If your cfg file is set out like:

Name=SK
FavWord=Delicious


So you only have one item per line, you should just be able to add the second element of the array:

foreach (string s in lines)
 {
   if (s == "" || s.StartsWith(" ") || s.StartsWith("/"))
   {
     continue;
   }
   string[] parts = s.Split(new char[] { '=' });
   fields.Add(parts[1]);
 }


Also, it might be worth your while to check out the Dictionary class, which may work out better for you. With a dictionary you can add an item like this:

myDict.Add("Name", "SK");
//And then get the value of the setting 'Name'...
string m_name = myDict["Name"];


Handy stuff.

EDIT: Wow I need to post quicker. When I first hit 'Reply' this question had no answers!

My current favourite word is: Delicious!
-SK Genius

Game Programming articles start -here[^]-

GeneralRe: Problem with String.Split() Pin
Henry Minute24-Jun-09 10:24
Henry Minute24-Jun-09 10:24 
QuestionNeed date formate like yyyy-MM-dd with time like "2008-07-08 20:24:14" in Excel Pin
attalurisubbu24-Jun-09 8:01
attalurisubbu24-Jun-09 8:01 
AnswerRe: Need date formate like yyyy-MM-dd with time like "2008-07-08 20:24:14" in Excel Pin
PIEBALDconsult24-Jun-09 9:45
mvePIEBALDconsult24-Jun-09 9:45 
AnswerRe: Need date formate like yyyy-MM-dd with time like "2008-07-08 20:24:14" in Excel Pin
0x3c024-Jun-09 9:49
0x3c024-Jun-09 9:49 
QuestionHow To Transfer Parameters Through 2 Forms Pin
treuveni24-Jun-09 6:42
treuveni24-Jun-09 6:42 
AnswerRe: How To Transfer Parameters Through 2 Forms Pin
Manas Bhardwaj24-Jun-09 6:43
professionalManas Bhardwaj24-Jun-09 6:43 
GeneralRe: How To Transfer Parameters Through 2 Forms Pin
treuveni24-Jun-09 7:36
treuveni24-Jun-09 7:36 
AnswerRe: How To Transfer Parameters Through 2 Forms Pin
Giorgi Dalakishvili24-Jun-09 7:22
mentorGiorgi Dalakishvili24-Jun-09 7:22 
QuestionThe best way to achive this ? Pin
viralthebest24-Jun-09 6:40
viralthebest24-Jun-09 6:40 
AnswerRe: The best way to achive this ? Pin
Christian Graus24-Jun-09 10:38
protectorChristian Graus24-Jun-09 10:38 
QuestionProblems with System Tray Graph ? Pin
Rsesky00024-Jun-09 6:23
Rsesky00024-Jun-09 6:23 
AnswerRe: Problems with System Tray Graph ? Pin
OriginalGriff24-Jun-09 6:57
mveOriginalGriff24-Jun-09 6:57 
QuestionBetter way to achive this ? Pin
eAero24-Jun-09 6:10
eAero24-Jun-09 6:10 
AnswerRe: Better way to achive this ? Pin
PIEBALDconsult24-Jun-09 6:42
mvePIEBALDconsult24-Jun-09 6:42 
QuestionHow to execute .jar file in c# Pin
Gresziu24-Jun-09 6:04
Gresziu24-Jun-09 6:04 
AnswerRe: How to execute .jar file in c# Pin
Ravadre24-Jun-09 7:56
Ravadre24-Jun-09 7:56 
GeneralRe: How to execute .jar file in c# Pin
Gresziu24-Jun-09 23:45
Gresziu24-Jun-09 23:45 

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.