-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileWorker.cs
More file actions
30 lines (28 loc) · 756 Bytes
/
FileWorker.cs
File metadata and controls
30 lines (28 loc) · 756 Bytes
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
namespace ProxyFinderAndChecker
{
public class FileWorker
{
static readonly object _ThreadLock = new object();
public static string[] ReadFile(string path)
{
return File.ReadAllLines(path);
}
public static void WriteFile(string text, string path)
{
lock (_ThreadLock)
{
try
{
if (!File.Exists(path)) File.Create(path).Close();
using (StreamWriter writer = new StreamWriter(path, true))
{
writer.WriteLine(text);
};
}
catch
{
}
}
}
}
}