Article Cruise

Latest news, Technologies, TV series, Movies, Design and Fashion, DIY

WinForms and C#, remove flickering from your Form.

Posted on | October 10, 2014 | No Comments

To remove the flickering from your form, add the following line to your C# application, beware of compatibility issues with Windows XP (You might face some problems when loading images dynamically)

Visual Studio 2013 RC, assembly could not be loaded even if it’s referenced!!

Posted on | October 16, 2013 | No Comments

Working on a C# project, I downloaded Visual Studio 2013 RC, I had this problem: I had a lot of projects in for the same solution. The projects were referenced correctly and everything was working fine on Visual Studio 2013 Preview. But when I moved to RC, the problem came up.

So, here’s what I did to fix everything:

  • Accessed every project by itself.
  • Set all the projects’ to the same target framework and same build platform.
  • Basically, removed all the warning that I used to get
  • Build every project as separate from the other ones.
  • Saved every project as a solution

And then everything went back to normal.

I hope this helps someone.

C# find files recursively with depth

Posted on | October 4, 2013 | No Comments

sDir is the directory to search, depth is the depth of directories to search into…

        static int globaldepth = 0;
        public static List<string> DirSearch(string sDir, int depth, bool scanRoot=true)
        {
            List<string> files = new List<string>();
            if (depth == 0) return files;
            if (globaldepth == 0)//scan current folder
            {
                foreach (string f in Directory.GetFiles(sDir))
                {
                    files.Add(f);
                }
            }
            globaldepth++;
            try
            {
                foreach (string d in Directory.GetDirectories(sDir))
                {
                    foreach (string f in Directory.GetFiles(d))
                    {
                        files.Add(f);
                    }
                    files.AddRange(DirSearch(d, depth - 1));
                }
            }
            catch (System.Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            return files;
        }

Search

Admin message

The articles posted in French are different than the ones in English!

Social

Archives

About

We post what we think, we post news, we post...

Subscribe to our feed

Admin