[ Download Code ]
After the application is finished a final message is displayed stating that three files have been created. These files are created in the same directory where the console application is located. Then the program waits for one final input. This allows the user to see the file creation message. Just press enter to end the program or close the window.
// Final message
Console.Write("The following files have been created: " + File1 + ".xml, " +
File1 + ".xsl, " + File1 + ".htm. ") ;
// Keeps the application running until enter is pressed
string input = Console.ReadLine();
Here is what you will see when running the application:
Please enter the file name: Contacts
Please enter the number of fields:3
Please enter the name for field 1: Name
Please enter the name for field 2: Address
Please enter the name for field 3: Phone
The following files have been created: Contacts.xml, Contacts.xsl, Contacts.htm
This application is simple and very useful for web developers by providing a means to quickly create XML files without the tedious use of HTML tags. It would be very easy to customize it for creating specific types of XML and XSL files. I hope you find a place for it in your toolbox as I have.