25.12.2014 Views

Analysis and Evaluation of the Windows Event Log - Bill Buchanan

Analysis and Evaluation of the Windows Event Log - Bill Buchanan

Analysis and Evaluation of the Windows Event Log - Bill Buchanan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C:\Documents <strong>and</strong> Settings\Barrie\My ...\<strong>Event</strong><strong>Log</strong>Tester\<strong>Event</strong><strong>Log</strong>Tester\Form1.cs<br />

File.Move(myFileName, newFileName);<br />

}<br />

}<br />

}<br />

2<br />

}<br />

}<br />

private void button3_Click(object sender, <strong>Event</strong>Args e)<br />

{<br />

for (int i = 0; i < fileCounter; i++)<br />

{<br />

string myFileName = "c:\\Test\\Sample" + Convert.ToString(i) + ".txt";<br />

string newFileName = "c:\\Test\\NewSample" + Convert.ToString(i) + ".txt";<br />

if (File.Exists(myFileName))<br />

{<br />

File.Delete(myFileName);<br />

}<br />

if (File.Exists(newFileName))<br />

{<br />

File.Delete(newFileName);<br />

}<br />

}<br />

}<br />

private void button10_Click(object sender, <strong>Event</strong>Args e)<br />

{<br />

fileCounter = Convert.ToInt32(textBox2.Text);<br />

textBox1.Text += ("\r\nFile Counter = " + fileCounter);<br />

textBox1.Select(textBox1.Text.Length + 1, 2);<br />

textBox1.ScrollToCaret();<br />

}<br />

private void button6_Click(object sender, <strong>Event</strong>Args e)<br />

{<br />

textBox1.Text += "\r\n";<br />

R<strong>and</strong>om num = new R<strong>and</strong>om();<br />

int myNum = Convert.ToInt16(num.Next(1, fileCounter));<br />

textBox1.Text += myNum;<br />

for (int i = 0; i < fileCounter; i++)<br />

{<br />

if (myNum==i)<br />

{<br />

string myFileName2 = "c:\\Test 2\\Sev<strong>Event</strong>.txt";<br />

TextWriter tsw2;<br />

if (File.Exists(myFileName2))<br />

{<br />

tsw2 = File.AppendText(myFileName2);<br />

tsw2.Write("\r\nThis file has been modified. Number: " + myNum);<br />

tsw2.Close();<br />

}<br />

}<br />

string myFileName = "c:\\Test\\Sample" + Convert.ToString(i) + ".txt";<br />

TextWriter tsw;<br />

tsw = new StreamWriter(@myFileName);<br />

tsw.Close();<br />

}<br />

textBox1.Select(textBox1.Text.Length + 1, 2);<br />

textBox1.ScrollToCaret();<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!