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

C#

 
QuestionCalling an OpenCV function Pin
E6AD27-Aug-05 10:30
E6AD27-Aug-05 10:30 
AnswerRe: Calling an OpenCV function Pin
Mohamad Al Husseiny27-Aug-05 11:29
Mohamad Al Husseiny27-Aug-05 11:29 
GeneralRe: Calling an OpenCV function Pin
Anonymous27-Aug-05 12:25
Anonymous27-Aug-05 12:25 
QuestionTutorial on writing and reading configuration file Pin
Fredy27-Aug-05 10:06
Fredy27-Aug-05 10:06 
AnswerRe: Tutorial on writing and reading configuration file Pin
Mohamad Al Husseiny27-Aug-05 10:23
Mohamad Al Husseiny27-Aug-05 10:23 
AnswerRe: Tutorial on writing and reading configuration file Pin
Fredy27-Aug-05 10:58
Fredy27-Aug-05 10:58 
QuestionEncryption/Decryption Pin
just4ulove727-Aug-05 7:16
just4ulove727-Aug-05 7:16 
AnswerRe: Encryption/Decryption Pin
Dave Shaw27-Aug-05 8:33
Dave Shaw27-Aug-05 8:33 
GeneralRe: Encryption/Decryption Pin
just4ulove727-Aug-05 8:37
just4ulove727-Aug-05 8:37 
QuestionDynamicaly moving controls at runtime Pin
Mutty27-Aug-05 6:13
Mutty27-Aug-05 6:13 
AnswerRe: Dynamicaly moving controls at runtime Pin
[Marc]27-Aug-05 6:18
[Marc]27-Aug-05 6:18 
GeneralRe: Dynamicaly moving controls at runtime Pin
Mutty27-Aug-05 6:49
Mutty27-Aug-05 6:49 
AnswerRe: Dynamicaly moving controls at runtime Pin
gnjunge27-Aug-05 7:54
gnjunge27-Aug-05 7:54 
QuestionFind Windows version remotely Pin
notacake27-Aug-05 4:06
notacake27-Aug-05 4:06 
AnswerRe: Find Windows version remotely Pin
Matt Gerrans27-Aug-05 7:02
Matt Gerrans27-Aug-05 7:02 
Questionwhat differences came from 'component' and 'windows form'? Pin
Sasuko27-Aug-05 2:49
Sasuko27-Aug-05 2:49 
QuestionLine Count and Byte Count Pin
Mridang Agarwalla27-Aug-05 2:45
Mridang Agarwalla27-Aug-05 2:45 
AnswerRe: Line Count and Byte Count Pin
FalkoD27-Aug-05 3:22
FalkoD27-Aug-05 3:22 
AnswerRe: Line Count and Byte Count Pin
Mohamad Al Husseiny27-Aug-05 3:39
Mohamad Al Husseiny27-Aug-05 3:39 
GeneralRe: Line Count and Byte Count Pin
Lord Kixdemp27-Aug-05 12:58
Lord Kixdemp27-Aug-05 12:58 
AnswerRe: Line Count and Byte Count Pin
Guffa27-Aug-05 5:28
Guffa27-Aug-05 5:28 
NewsRe: Line Count and Byte Count Pin
Rei Miyasaka29-Aug-05 13:04
Rei Miyasaka29-Aug-05 13:04 
To read the number of bytes, you can use Systm.Text.Encoding.Default.GetByteCount.
The most accurate way to count lines would probably be to use StringReader.ReadLine, but if that's too much overhead, try this function:

static int LineCount(string str)
{
	int lines = 1;
	for(int i = 0; i < str.Length; i++)
	{
		if(str[i] == '\r' || str[i] == '\n')
		{
			if(i+1 < str.Length && (str[i] == '\r' && str[i+1] == '\n'))
				i++;
			lines++;
		}
	}
	return lines;
}


-- modified at 19:13 Monday 29th August, 2005
QuestionC# and Excel Pin
surfman1927-Aug-05 0:39
surfman1927-Aug-05 0:39 
AnswerRe: C# and Excel Pin
Mohamad Al Husseiny27-Aug-05 1:27
Mohamad Al Husseiny27-Aug-05 1:27 
GeneralRe: C# and Excel Pin
surfman1927-Aug-05 1:44
surfman1927-Aug-05 1:44 

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.