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

C#

 
QuestionGetting Fileinfo and fileattributes in one read operation ? Pin
fracalifa23-Apr-09 1:41
fracalifa23-Apr-09 1:41 
QuestionShow the progress bar while executing a batch file in C# windows forms? [modified] Pin
Nitin Jenekar23-Apr-09 1:40
Nitin Jenekar23-Apr-09 1:40 
AnswerRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
DaveyM6923-Apr-09 1:48
professionalDaveyM6923-Apr-09 1:48 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar28-Apr-09 2:45
Nitin Jenekar28-Apr-09 2:45 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
DaveyM6928-Apr-09 4:05
professionalDaveyM6928-Apr-09 4:05 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar7-May-09 3:19
Nitin Jenekar7-May-09 3:19 
AnswerRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Rob Philpott23-Apr-09 1:54
Rob Philpott23-Apr-09 1:54 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
MumbleB23-Apr-09 2:13
MumbleB23-Apr-09 2:13 
Rob Philpott wrote:
Personally I don't think there's an acceptable solution to doing that. Progress bars tell you how far through an operation you are. How do we know?


Have you used progressbars before? Doing a quick count of the number of Lines in your file and then passing that to the progressbar.Maximum gives you the number of lines you are processing.
<br />
            string line = sr.ReadLine();<br />
            while (line != null)<br />
            {<br />
                line = sr.ReadLine();<br />
                lineCount++;<br />
            }<br />
            sr.Close();<br />
            lineTot = lineCount;<br />

Once you have the total number of lines you can pass that through to the ProgressBar.Maximum.
<br />
            progressBar1.Minimum = 0;<br />
            progressBar1.Maximum = lineTot;<br />

Your answer seem to indicate that it is impossible to do and not worth it. I have implimented this in about less than 10 lines of code.

Excellence is doing ordinary things extraordinarily well.

GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Marc A. Brown23-Apr-09 2:29
Marc A. Brown23-Apr-09 2:29 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Rob Philpott23-Apr-09 2:56
Rob Philpott23-Apr-09 2:56 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar23-Apr-09 3:13
Nitin Jenekar23-Apr-09 3:13 
GeneralRe: How to show the progress bar while executing a batch file in C# windows forms? Pin
MumbleB23-Apr-09 3:36
MumbleB23-Apr-09 3:36 
AnswerRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Luc Pattyn23-Apr-09 3:52
sitebuilderLuc Pattyn23-Apr-09 3:52 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar23-Apr-09 19:32
Nitin Jenekar23-Apr-09 19:32 
AnswerRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Henry Minute23-Apr-09 5:06
Henry Minute23-Apr-09 5:06 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar23-Apr-09 19:37
Nitin Jenekar23-Apr-09 19:37 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Henry Minute23-Apr-09 23:51
Henry Minute23-Apr-09 23:51 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar24-Apr-09 2:26
Nitin Jenekar24-Apr-09 2:26 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Henry Minute24-Apr-09 2:37
Henry Minute24-Apr-09 2:37 
GeneralRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar24-Apr-09 2:47
Nitin Jenekar24-Apr-09 2:47 
AnswerRe: Show the progress bar while executing a batch file in C# windows forms? Pin
Nitin Jenekar20-May-09 0:35
Nitin Jenekar20-May-09 0:35 
QuestionERROR_FILE_NOT_FOUND while using GetUrlCacheEntryInfo() ? Pin
svt gdwl23-Apr-09 0:57
svt gdwl23-Apr-09 0:57 
QuestionNetwork Authority Pin
Programm3r22-Apr-09 23:50
Programm3r22-Apr-09 23:50 
Questionvsts 2008 unit testing Pin
BabyOreo22-Apr-09 22:44
BabyOreo22-Apr-09 22:44 
AnswerRe: vsts 2008 unit testing Pin
smurariu23-Apr-09 3:46
smurariu23-Apr-09 3:46 

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.