想删除指定路径下的所有日志文件,但是要排除其中指定的某个(多个)文件夹,代码如下:
             try
            { 
                DirectoryInfo d = new DirectoryInfo( @"\\server01\c$\windows");                DirectoryInfo[] dirs = d.GetDirectories();
                foreach (DirectoryInfo item in dirs)
                {
                    string ExcludeRegEx = @"\\server01\c$\windows\System32";
                    Regex reg = new Regex(ExcludeRegEx, RegexOptions.IgnoreCase);
                    Match match = reg.Match(item.FullName);
                    if (match.Success)
                    {
                        Console.WriteLine("match success");
                    }
                    else
                    {
                        Console.WriteLine("match not success");
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
程序第7行抛出异常,
Message = "parsing \"\\\\server01\\c$\\windows\\System32\" - Unrecognized control character."请问ExcludeRegEx  该如何写??