Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
JokeWhat are trees doing in your pants? Pin
Naruki15-Apr-09 15:18
Naruki15-Apr-09 15:18 
GeneralRe: What are trees doing in your pants? Pin
Neville Franks15-Apr-09 16:26
Neville Franks15-Apr-09 16:26 
JokeRe: What are trees doing in your pants? Pin
Naruki15-Apr-09 16:54
Naruki15-Apr-09 16:54 
GeneralRe: What are trees doing in your pants? Pin
Neville Franks15-Apr-09 18:00
Neville Franks15-Apr-09 18:00 
QuestionProgress while reading a file Pin
nike_arh15-Apr-09 10:38
nike_arh15-Apr-09 10:38 
AnswerRe: Progress while reading a file Pin
amtadhani15-Apr-09 10:45
amtadhani15-Apr-09 10:45 
GeneralRe: Progress while reading a file Pin
nike_arh15-Apr-09 10:53
nike_arh15-Apr-09 10:53 
AnswerRe: Progress while reading a file Pin
Luc Pattyn15-Apr-09 10:55
sitebuilderLuc Pattyn15-Apr-09 10:55 
Hi,

as there is no need to read the entire file at once, don't do it. It increases your memory footprint and probably decreases performance. Use the stream instead.

((reader.BaseStream.Position / reader.BaseStream.Length) * 100) is wrong: since the division has two integer operands, with numerator <= denominator, it will equal zero until the end, where it becomes one. The right way to do this is first convert at least one number to float or double, then multiply by 100, then divide, then convert back to int.

if this is a console app, there is no need for extra threads, the console would be just waiting anyway.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of

GeneralRe: Progress while reading a file Pin
nike_arh15-Apr-09 11:14
nike_arh15-Apr-09 11:14 
GeneralRe: Progress while reading a file Pin
Luc Pattyn15-Apr-09 11:19
sitebuilderLuc Pattyn15-Apr-09 11:19 
QuestionList view question Pin
al3xutzu0015-Apr-09 10:03
al3xutzu0015-Apr-09 10:03 
AnswerRe: List view question Pin
Luc 64801115-Apr-09 10:07
Luc 64801115-Apr-09 10:07 
GeneralRe: List view question Pin
DaveyM6915-Apr-09 10:08
professionalDaveyM6915-Apr-09 10:08 
AnswerRe: List view question Pin
DaveyM6915-Apr-09 10:07
professionalDaveyM6915-Apr-09 10:07 
AnswerRe: List view question Pin
al3xutzu0015-Apr-09 10:10
al3xutzu0015-Apr-09 10:10 
Questionweb develpoment Pin
elazor15-Apr-09 9:46
elazor15-Apr-09 9:46 
AnswerRe: web develpoment Pin
buachaill cliste15-Apr-09 10:02
buachaill cliste15-Apr-09 10:02 
GeneralRe: web develpoment Pin
elazor15-Apr-09 19:14
elazor15-Apr-09 19:14 
QuestionSpreadsheet COM in window form application Pin
Binqing15-Apr-09 8:47
Binqing15-Apr-09 8:47 
AnswerRe: Spreadsheet COM in window form application Pin
buachaill cliste15-Apr-09 10:40
buachaill cliste15-Apr-09 10:40 
GeneralRe: Spreadsheet COM in window form application Pin
Binqing15-Apr-09 11:01
Binqing15-Apr-09 11:01 
QuestionCreating a DataTable with the data from an SQL SELECT statement Pin
stonebergftw15-Apr-09 8:31
stonebergftw15-Apr-09 8:31 
AnswerRe: Creating a DataTable with the data from an SQL SELECT statement Pin
PIEBALDconsult15-Apr-09 10:17
mvePIEBALDconsult15-Apr-09 10:17 
GeneralRe: Creating a DataTable with the data from an SQL SELECT statement Pin
stonebergftw15-Apr-09 11:02
stonebergftw15-Apr-09 11:02 
GeneralRe: Creating a DataTable with the data from an SQL SELECT statement Pin
PIEBALDconsult16-Apr-09 6:59
mvePIEBALDconsult16-Apr-09 6:59 

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.