Click here to Skip to main content
15,896,912 members
Home / Discussions / C#
   

C#

 
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 
QuestionConnecting application with certain filetype Pin
Member 213090427-Aug-05 0:18
Member 213090427-Aug-05 0:18 
AnswerRe: Connecting application with certain filetype Pin
beatles169227-Aug-05 3:03
beatles169227-Aug-05 3:03 
GeneralRe: Connecting application with certain filetype Pin
29-Aug-05 1:58
suss29-Aug-05 1:58 
QuestionWhere is Smart Device Application project? Pin
Libor Tinka26-Aug-05 23:37
Libor Tinka26-Aug-05 23:37 
QuestionWeb Update Pin
StephenMcAllister26-Aug-05 23:25
StephenMcAllister26-Aug-05 23:25 
GeneralRe: Web Update Pin
| Muhammad Waqas Butt |27-Aug-05 4:39
professional| Muhammad Waqas Butt |27-Aug-05 4:39 
AnswerRe: Web Update Pin
Mohamad Al Husseiny27-Aug-05 4:46
Mohamad Al Husseiny27-Aug-05 4:46 
Questionquestion on reference types Pin
Anonymous26-Aug-05 19:53
Anonymous26-Aug-05 19:53 
AnswerRe: question on reference types Pin
leppie26-Aug-05 20:09
leppie26-Aug-05 20:09 
GeneralRe: question on reference types Pin
Anonymous26-Aug-05 20:32
Anonymous26-Aug-05 20:32 
AnswerRe: question on reference types Pin
Guffa26-Aug-05 21:02
Guffa26-Aug-05 21:02 
GeneralRe: question on reference types Pin
Anonymous26-Aug-05 21:40
Anonymous26-Aug-05 21:40 
GeneralRe: question on reference types Pin
Matt Gerrans26-Aug-05 21:47
Matt Gerrans26-Aug-05 21:47 
QuestionDLLs in C# Application Pin
amitmohanty26-Aug-05 13:50
amitmohanty26-Aug-05 13:50 

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.