AutoEventWireup is set to true by default, which means you dont need to wire your events, just write your event handler functions and they will be registered automatically. The code below writes three lines of text to a file using Page_Unload event handler.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void Page_Unload(object sender, EventArgs e)
// Compose a string that consists of three lines.
string lines = "First line.\r\nSecond line.\r\nThird line.";
// Write the string to a file.
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");