01.
System.IO.Directory.GetFiles(folSong,
"*.mp3"
).ToList<
string
>()
02.
.Where(f =>
new
Regex(@
"(_\d{1,})"
, RegexOptions.None).IsMatch(Path.GetFileName(f)) ||
03.
new
Regex(@
"^(\d{1,})[\s\.-]{1,}"
, RegexOptions.None).IsMatch(Path.GetFileName(f)))
04.
.ToList<
string
>()
05.
.ForEach(_f =>
06.
{
07.
string
__f = folSong +
"\\"
+
08.
new
Regex(@
"^(\d{1,})[\s\.-]{1,}"
, RegexOptions.None).Replace(
09.
new
Regex(@
"(_\d{1,})"
, RegexOptions.None).Replace(Path.GetFileName(_f),
""
),
""
);
10.
11.
12.
this
.Invoke(
new
Action(() =>
this
.Text =
"Check File:"
+ _f));
13.
if
(!System.IO.File.Exists(__f))
14.
{
15.
System.IO.File.Move(_f, __f);
16.
}
17.
else
18.
{
19.
20.
long
a =
new
FileInfo(_f).Length;
21.
long
b =
new
FileInfo(__f).Length;
22.
if
(a >= b - 0.3 * b && a <= b + 0.3 * b)
23.
System.IO.File.Delete(_f);
24.
}
25.
});