Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#@ import namespace="System" #>
- <#@ import namespace="System.Collections.Generic" #>
- <#@ import namespace="System.Text" #>
- <#@ import namespace="System.Text.RegularExpressions" #>
- <#@ import namespace="System.IO" #>
- <#+
- List<String> files = new List<String>();
- string FileToId(string file){ return System.Text.RegularExpressions.Regex.Replace(file, "^[A-Za-z0-9_]", "x"); }
- void GetFiles(string path,List<string> excludedExtensions)
- {
- string[] dirs = Directory.GetDirectories(path);
- for (var i = 0; i < dirs.Length; i++)
- {
- GetFiles(dirs[i],excludedExtensions );
- }
- string [] loopFiles = Directory.GetFiles(path);
- for (var i = 0; i < loopFiles.Length; i++)
- {
- if (excludedExtensions==null ||
- !excludedExtensions.Contains(System.IO.Path.GetExtension(loopFiles[i])))
- {
- files.Add(loopFiles[i]);
- }
- }
- }
- #>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement