/// <summary> /// Click event handler for btnCreateFile which creates a binary file and writes some default contents in it /// </summary> /// <param name="sender">Object on which event has occured</param> /// <param name="e">Args for the event</param> protected void btnCreateFile_Click(object sender, EventArgs e) { //Path for the source file string fileName = @"C:\Test\source.bin"; //Call to the CreateFiles() method to create the binary file bool result = UtilityFunctions.CreateFiles(fileName); //checking the file creation result if (result) { //if success //writing the contents to the file UtilityFunctions.AddContentsToFile(fileName); Response.Write(Messages.FileCreationSuccess); } else { //if failed Response.Write(Messages.FileCreationFailed); } }