Click here to Skip to main content
15,906,335 members
Home / Discussions / C#
   

C#

 
QuestionWindowsPrincipal object gives null value for username when checked in component Pin
Naveen S H8-Oct-07 0:41
Naveen S H8-Oct-07 0:41 
QuestionWhere will be the assembly stores in the System Pin
pashitech8-Oct-07 0:40
pashitech8-Oct-07 0:40 
AnswerRe: Where will be the assembly stores in the System Pin
Pete O'Hanlon8-Oct-07 1:45
mvePete O'Hanlon8-Oct-07 1:45 
QuestionError while using System.Net.Mail.SmtpClient to send mail Pin
A M SOMAN7-Oct-07 22:59
A M SOMAN7-Oct-07 22:59 
AnswerRe: Error while using System.Net.Mail.SmtpClient to send mail Pin
Andrei Ungureanu7-Oct-07 23:23
Andrei Ungureanu7-Oct-07 23:23 
GeneralRe: Error while using System.Net.Mail.SmtpClient to send mail Pin
A M SOMAN8-Oct-07 0:49
A M SOMAN8-Oct-07 0:49 
GeneralRe: Error while using System.Net.Mail.SmtpClient to send mail Pin
Andrei Ungureanu8-Oct-07 1:02
Andrei Ungureanu8-Oct-07 1:02 
QuestionHandling Text data taken from file Pin
rsaint277-Oct-07 22:54
rsaint277-Oct-07 22:54 
Hello,

I'm doing some free-time programming with learning objective (in c#), and one of my "projects" led me to separate data taken from a text file.
Opening and retrieving data is no problem, I just put it into a ArrayList of string element for now. But when I want to separate the data from that ArrayList, the only solution I've come up with is as 'ugly' as this one:

ArrayList stream = new ArrayList();
(some code here)
foreach (string str in stream)
{
if (str.contains(some string))
{
do something
}
else
{
if (str.contains(some other string))
{
do other thing
}
else
{
(... even more if's)
}
}
}

I think there should be another way to do this, specially without so much "contains" operations that are time consuming.
Can you give me some directions on how to break such items apart?
I'm thinking this could also be used in other areas like socket communication.

This feels like a very dumb question to me, but if I don't ask, I'll never learn.


Thanks for any help you can give me.
AnswerRe: Handling Text data taken from file Pin
Andrei Ungureanu7-Oct-07 23:27
Andrei Ungureanu7-Oct-07 23:27 
GeneralRe: Handling Text data taken from file Pin
rsaint278-Oct-07 0:09
rsaint278-Oct-07 0:09 
GeneralRe: Handling Text data taken from file Pin
Andrei Ungureanu8-Oct-07 0:48
Andrei Ungureanu8-Oct-07 0:48 
GeneralRe: Handling Text data taken from file Pin
rsaint278-Oct-07 0:59
rsaint278-Oct-07 0:59 
JokeRe: Handling Text data taken from file Pin
Andrei Ungureanu8-Oct-07 1:03
Andrei Ungureanu8-Oct-07 1:03 
QuestionOperator @ Masked textbox [modified] Pin
G. Mathu7-Oct-07 22:54
G. Mathu7-Oct-07 22:54 
AnswerRe: Operator @ Masked textbox Pin
Seishin#7-Oct-07 22:59
Seishin#7-Oct-07 22:59 
Questionvariable as type of generic (method) Pin
Seishin#7-Oct-07 22:50
Seishin#7-Oct-07 22:50 
AnswerRe: variable as type of generic (method) Pin
Eduard Keilholz8-Oct-07 2:16
Eduard Keilholz8-Oct-07 2:16 
GeneralRe: variable as type of generic (method) Pin
Seishin#8-Oct-07 2:20
Seishin#8-Oct-07 2:20 
GeneralRe: variable as type of generic (method) Pin
Guffa8-Oct-07 2:35
Guffa8-Oct-07 2:35 
QuestionBinary Equals Pin
Patricio Tapia7-Oct-07 21:55
Patricio Tapia7-Oct-07 21:55 
AnswerRe: Binary Equals Pin
Andrei Ungureanu7-Oct-07 22:35
Andrei Ungureanu7-Oct-07 22:35 
GeneralRe: Binary Equals Pin
Patricio Tapia7-Oct-07 22:38
Patricio Tapia7-Oct-07 22:38 
Questionfunction rectification Pin
Sonia Gupta7-Oct-07 21:46
Sonia Gupta7-Oct-07 21:46 
AnswerRe: function rectification Pin
pmarfleet7-Oct-07 21:57
pmarfleet7-Oct-07 21:57 
GeneralRe: function rectification Pin
Sonia Gupta7-Oct-07 22:15
Sonia Gupta7-Oct-07 22:15 

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.