Search Specified Type of File in drives- C#

 

private void GetFiles( )

        {

            DriveInfo[] allDrive = DriveInfo.GetDrives();
//Gets the drive names of all drives in the computer

            foreach (DriveInfo d in allDrive)

            {

                string b = d.Name.ToString();

                var filename = Directory.GetFiles(b“*.*”SearchOption.TopDirectoryOnly);
                                                   // it returns the all file with the path whose type is “*.*”.

                foreach (string a in filename)

                {                    MessageBox.Show(a);

                }

            }

        }

By Sriramjithendra Posted in C#.NET

Excuses by lazy programmers.

  1. It is a hardware problem.
  2. RAM must be increased to make the program fast.
  3. My code has been edited by someone. I have to find out who did that.
  4. Virus has corrupted the application.
  5. It worked yesterday.
  6. This was new to me, no big deal if bug appeared.
  7. Hmm.. (and deep thinking forever)
  8. I can’t think whether this can be crashed by some invalid data.
  9. Everything done and will work with all cases (without even testing)
  10. My code is almost completed. (It took more than a week to complete the rest)
  11. I will complete this by EOD (by EOD.. offline status!)
  12. I can’t reproduce this. You have to format your machine.
  13. Restart your machine.
  14. Do you have third party application installed, if yes, then it is causing the problem.
  15. I was on holiday last week, I don’t know how this happened.
  16. Why are you putting the wrong data?
  17. This issue is not as bad as you think.
  18. This is OS bug.
  19. This is Browser bug.
  20. I was not well today so there is probability of bugs to happen.
  21. Why should I document this. It is a time wastage.
  22. This cannot be fixed, tell the end users to open the application in the way it appears to be fixed.
  23. I will finish it ASAP (oh.. lunch time I am already jumped from my seat)
  24. I am a programmer and not a tester so if bug comes I am not responsible for it.
  25. I wrote this REGEX from my hands, from scratch. I am genius.
  26. I have so much work to do. I need requirements in advance (Status message: I love agile)
  27. So many issues coming.. I don’t understand what kind of QA team we have.
  28. I wrote the entire piece of code by myself.
  29. I am giving final touch to my design.
  30. My laptop battery is not charging so power fluctuations can produce bugs in my code.
  31. The QA guys doesn’t like me and because of envy they are logging these issues.
  32. I think server is slow today.
  33. Internet is slow. Test the application only when it becomes fast.
  34. It is already fixed but I cannot give the patch because my code is not compiling.
  35. I cannot be reproduce this, closing the bug.
  36. If this issue came then how did this ever work?
  37. Your browser version is different.
  38. This is a well known bug.
  39. Intelligent programmers do not document their code.
  40. Internet is too slow (since Youtube is running in HD mode in other tab)
By Sriramjithendra Posted in Others

How to Implement Message Contract in WCF.

Confuse when you go for Message Contract and when for Data Contract

Data contracts are used to define the data structure and generate the XML for the data you want to pass.
If you want to go for more control on your SOAP Message then you should go for a Message Contract.
Do not mix message contract and data contract.

http://www.c-sharpcorner.com/UploadFile/788083/how-to-implement-message-contract-in-wcf/

By Sriramjithendra Posted in WCF