Exemplo n.º 1
0
        public static void searchFilesinFolder(object obj)
        {
            string strPath  = obj.ToString();
            ouyyn  thisForm = (ouyyn)obj;

            strPath = thisForm.txt_filesName.Text;
            if (strPath != null && strPath.Length > 0)
            {
                if (Directory.Exists(strPath))
                {
                    searchedFiles.Clear();
                    List <string> allSearcheFiles = new List <string>();
                    List <string> folders2Search  = new List <string>();
                    folders2Search.Add(strPath);
                    while (folders2Search.Count > 0)
                    {
                        try
                        {
                            string curFolder = folders2Search[0];
                            folders2Search.RemoveAt(0);
                            string[] files = Directory.GetFiles(curFolder);
                            string[] dirs  = Directory.GetDirectories(curFolder);
                            foreach (string item in files)
                            {
                                allSearcheFiles.Add(item);
                            }
                            foreach (string item in dirs)
                            {
                                folders2Search.Add(item);
                            }
                        }
                        catch { }
                    }
                    searchedFiles.AddRange(allSearcheFiles);
                    thisForm.searchComplete(thisForm);
                }
            }
        }
Exemplo n.º 2
0
 private void textBox1_TextChanged(object sender, EventArgs e)
 {
     ouyyn form1 = new ouyyn();
 }