-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileOperation.cs
More file actions
46 lines (40 loc) · 840 Bytes
/
FileOperation.cs
File metadata and controls
46 lines (40 loc) · 840 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.IO;
namespace MultiPlatform.HtmlEditor
{
public static class FileOperation
{
public static string openRead(string filename)
{
string t = "";
if (File.Exists(filename))
{
if (filename != null)
t = File.ReadAllText(filename);
}
return t;
}
public static void saveFile(string fileContent,string filename)
{
createFile(filename);
if (File.Exists(filename))
{
if (filename != null) {
using (StreamWriter outputFile = new StreamWriter(filename))
{
outputFile.Write(fileContent);
}
}
}
}
public static void createFile(string filename)
{
if (filename != null)
{
using (StreamWriter outputFile = new StreamWriter(filename))
{
outputFile.Write("");
}
}
}
}
}