-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdataMiner.cs
More file actions
42 lines (34 loc) · 1.21 KB
/
dataMiner.cs
File metadata and controls
42 lines (34 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SharpML
{
public class dataMiner
{
public static void ProcessDirectory(string networkshare)
{
List<string> extensions = new List<string> { "bat", "vbs", "cmd", "ps1", "sh", "pl", "txt", "xml", "cfg", "conf", "ini", "vba", "inf", "prf", "json", "cmp", "sql" };
foreach (var file in Directory.EnumerateFiles(networkshare, "*.*", SearchOption.AllDirectories))
{
string ext = Path.GetExtension(file);
if (extensions.Any(ext.Contains))
{
var fltext = File.ReadAllLines(file);
foreach (string fl in fltext)
{
using (System.IO.StreamWriter filered = new System.IO.StreamWriter(System.Environment.GetEnvironmentVariable("TEMP") + @"\model_data.txt", true))
{
filered.WriteLine(fl);
}
}
}
else
{
continue;
}
}
}
}
}