-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm2.cs
58 lines (53 loc) · 1.71 KB
/
Form2.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace JSRF_Song_Mod_Tool
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public static void addLineToDebugLog(string text)
{
string[] tempArray = new string[Form2.richTextBox1.Lines.Length];
string[] tempArray2 = new string[richTextBox1.Lines.Length + 1];
tempArray = richTextBox1.Lines;
int count = 0;
tempArray2[count] = tempArray[0];
count++;
tempArray2[count] = text;
count++;
for (int counter = 2; counter < tempArray.Length; counter++)
{
tempArray2[counter] = tempArray[counter];
}
string strfn;
strfn = Convert.ToString(DateTime.Now.ToFileTime());
StreamWriter fs = new StreamWriter(strfn, true);
foreach (string s in tempArray2)
fs.WriteLine(s);
fs.Flush();
fs.Close();
string line;
richTextBox1.Clear();
System.IO.StreamReader file = new System.IO.StreamReader(strfn);
while ((line = file.ReadLine()) != null)
{
richTextBox1.AppendText("[" + DateTime.Now + "] " + line + "\n");
}
}
internal static void addLineToDebugLog2(String message)
{
addLineToDebugLog(message);
}
}
}