Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting XHTML tags by tag name Pin
harold aptroot25-Jun-09 7:26
harold aptroot25-Jun-09 7:26 
GeneralRe: Getting XHTML tags by tag name Pin
Jordanwb25-Jun-09 7:29
Jordanwb25-Jun-09 7:29 
GeneralRe: Getting XHTML tags by tag name Pin
harold aptroot25-Jun-09 7:30
harold aptroot25-Jun-09 7:30 
GeneralRe: Getting XHTML tags by tag name Pin
Jordanwb25-Jun-09 7:35
Jordanwb25-Jun-09 7:35 
Questionmenustirp items disappear from designer, but still in properties list Pin
ThorTheBraveGod24-Jun-09 11:26
ThorTheBraveGod24-Jun-09 11:26 
AnswerRe: menustirp items disappear from designer, but still in properties list Pin
Cracked-Down24-Jun-09 20:24
Cracked-Down24-Jun-09 20:24 
GeneralRe: menustirp items disappear from designer, but still in properties list Pin
ThorTheBraveGod25-Jun-09 3:19
ThorTheBraveGod25-Jun-09 3:19 
AnswerRe: menustirp items disappear from designer, but still in properties list Pin
ThorTheBraveGod25-Jun-09 10:21
ThorTheBraveGod25-Jun-09 10:21 
QuestionUnable to read data from the transport connection: An existing connection was forcibly closed by the remote host Pin
milenalukic24-Jun-09 11:10
milenalukic24-Jun-09 11:10 
AnswerRe: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host Pin
Colin Angus Mackay24-Jun-09 13:20
Colin Angus Mackay24-Jun-09 13:20 
GeneralRe: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host Pin
milenalukic24-Jun-09 22:08
milenalukic24-Jun-09 22:08 
QuestionEncrypted Connection Pin
ziwez024-Jun-09 9:23
ziwez024-Jun-09 9:23 
AnswerRe: Encrypted Connection Pin
harold aptroot24-Jun-09 9:47
harold aptroot24-Jun-09 9:47 
GeneralRe: Encrypted Connection Pin
EliottA25-Jun-09 2:53
EliottA25-Jun-09 2:53 
GeneralRe: Encrypted Connection Pin
harold aptroot25-Jun-09 4:07
harold aptroot25-Jun-09 4:07 
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 

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.