GetFiles with 2 extensions in the Search Pattern

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to do a Search Pattern for .jpgs and .tifs. I can do one or the other:
GetFiles(pathString, "*.jpg") 'or
GetFiles(pathString, "*.tif")

But I want a search pattern that does both.
 
Hi,

As the link below said, the OR operation in search pattern is not
supported. We may need to do twice search.
http://groups.google.com/groups?hl=zh-CN&lr=&c2coff=1&threadm=A52AFEC2-E1E6-
4671-93FE-FF209C9670B6%40microsoft.com&rnum=1&prev=/groups%3Fq%3DDirectory%2
520GetFiles%2520searchPattern%2520OR%26hl%3Dzh-CN%26lr%3D%26c2coff%3D1%26sa%
3DN%26tab%3Dwg
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

I think you may try to use the approach below to merge the two arrays

string[] ar1 = new string[3]{"1","2","3"};
string[] ar2 = new string[2]{"4","5"};
string[] arMerge = new string[ar1.Length+ar2.Length];
Array.Copy(ar1,0,arMerge,0,ar1.Length);
Array.Copy(ar2,0,arMerge,ar1.Length,ar2.Length);
for(int i=0;i<arMerge.Length;i++)
{
System.Diagnostics.Debug.WriteLine(arMerge);
}


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top