Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using (IEnumerator<string> filepaths = System.IO.Directory.EnumerateFiles(startPath, "*", System.IO.SearchOption.AllDirectories).GetEnumerator())
  2. {
  3. while (true){
  4. try{
  5. if (!filepaths.MoveNext()){//im getting OOM here
  6. break;
  7. }
  8. }catch (Exception e){
  9. }
  10. }
  11. }
  12.  
  13. foreach(string path in System.IO.Directory.EnumerateFiles(startPath, "*", System.IO.SearchOption.AllDirectories)){
  14. //do the processing in path
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement