Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
put multiple image files to the clipboard
#6
The `GetFiles` function in Code1 does not support regular expressions. Therefore, in Code2, I used the `enumFiles` function from LA, which seems a bit complex. It would be very convenient to have an extension method for `GetFiles` that supports regular expressions.

Code1:
Code:
Copy      Help
var ar1 = Directory.GetFiles(dirPath, "AZ?.jpeg"); //files as string[]
print.it(ar1);
var dimg = new clipboardData().AddFiles(ar1);

Code2:
Code:
Copy      Help
var a = filesystem.enumFiles(dirPath, "**m AZ?.jpeg||SX?.jpeg").ToArray();
List<string> paths = new List<string>();
foreach (var f in a) {
    var path = f.FullPath;
    print.it(path);
}
string[] ar1 = paths.ToArray();
var dimg = new clipboardData().AddFiles(ar1);


Messages In This Thread
RE: put multiple image files to the clipboard - by Davider - 04-05-2024, 04:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)