Save Raw data
This commit is contained in:
@@ -8,18 +8,24 @@ namespace Server
|
||||
class SaveData
|
||||
{
|
||||
private string path;
|
||||
public SaveData(string path)
|
||||
private string filename;
|
||||
public SaveData(string path, string filename)
|
||||
{
|
||||
this.path = path;
|
||||
this.filename = filename;
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Every line is a new data entry
|
||||
/// </summary>
|
||||
|
||||
public void WriteDataJSON(string data)
|
||||
{
|
||||
using (StreamWriter sw = File.AppendText(this.path + "/dataJSON.txt"))
|
||||
using (StreamWriter sw = File.AppendText(this.path + "/json"+filename+".txt"))
|
||||
{
|
||||
sw.WriteLine(data);
|
||||
}
|
||||
@@ -27,7 +33,7 @@ namespace Server
|
||||
|
||||
public void WriteDataRAW(string data)
|
||||
{
|
||||
using (StreamWriter sw = File.AppendText(this.path + "/dataRAW.txt"))
|
||||
using (StreamWriter sw = File.AppendText(this.path + "/raw" + filename + ".txt"))
|
||||
{
|
||||
sw.WriteLine(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user