blank_program's Profile User Rating: -----

Reputation: 11 Tradesman
Group:
Contributors
Active Posts:
280 (0.16 per day)
Joined:
22-July 09
Profile Views:
7,746
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Pontiac
Dream Kudos:
100

Latest Visitors

Icon   blank_program has not set their status

Posts I've Made

  1. In Topic: Reuse panel question

    Posted 5 Feb 2014

    I would like to use one window to encompass controls for various options. Rather than have tons of windows I just want to alter my single window.
  2. In Topic: What version control system to use

    Posted 13 Apr 2013

    I have decided to use Mercurial but now it is a matter of finding out where I want to host my project. Either Google Code or Sourceforge.
  3. In Topic: How to reprint a line in the console

    Posted 26 Mar 2013

    View PosttlhIn`toq, on 26 March 2013 - 05:27 PM, said:

    Please show your entire loop code


    Here you go. My class is pretty big and I would rather nto be judged on poor code but this is the only place that calls ReportProgress. This is a full console application only no real GUI.
            internal void HashData(string HashType = "md5")
            {
                if (FullFileList != null)
                {
                    for (int i = 0; i < FullFileList.Count; i++)
                    {
                        if (i == 0 && HashType.Length > 0)
                        {
                            DataLogger.WriteApplicationLog("\nHashing data as " + HashType.ToUpper());
                        }
                        else if (i == 0 && HashType.Length == 0)
                        {
                            DataLogger.WriteApplicationLog("Hashing data as MD5");
                        }
    
                        if (File.Exists(FullFileList[i].FullName))
                        {
                            switch (HashType)
                            {
                                case "md5":
                                    Hasher.HashFileMD5(FullFileList[i].FullName);
                                    break;
                                case "sha1":
                                    Hasher.HashFileSHA1(FullFileList[i].FullName);
                                    break;
                                case "sha256":
                                    Hasher.HashFileSHA256(FullFileList[i].FullName);
                                    break;
                                case "sha512":
                                    Hasher.HashFileSHA512(FullFileList[i].FullName);
                                    break;
                                default:
                                    Hasher.HashFileMD5(FullFileList[i].FullName);
                                    break;
                            }
    
                            if (i != 0)
                            {
                                ReportProgress(i + 1, FullFileList[i].FullName);
                            }
                            else
                            {
                                Console.WriteLine();
                                ReportProgress(i, FullFileList[i].FullName);
                            }
                        }
                    }
    
                    DataLogger.WriteApplicationLog("Data hashing complete.");
                }
            }
    
  4. In Topic: How to reprint a line in the console

    Posted 26 Mar 2013

    Example output:
    Progress 99.00%     Files remaining: 100
    
    


    But then once it decrements files remaining by 1 you then get:
    Progress 99.00%     Files remaining: 990
    
    
  5. In Topic: How to reprint a line in the console

    Posted 26 Mar 2013

    Problem appears fixed as so:
            internal void ReportProgress(int CurrentIndex, string FileName)
            {
                Console.Write("\rProgress: " + ((decimal)CurrentIndex / (decimal)FullFileList.Length).ToString("p2") + '\t');
                Console.Write("Files remaining: " + (FullFileList.Length - CurrentIndex) + ' ');
            }
    
    


    It is hard to capture this on my system as it counts down a bit quickly.

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private
Website URL:
Website URL  http://