Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _11.AddCakes
- {
- using System;
- using System.IO;
- public static class AddCakes
- {
- public static void Main()
- {
- Console.WriteLine("Content-Type: text/html\r\n");
- string htmlContent = File.ReadAllText("../www/addcakes.html");
- Console.WriteLine(htmlContent);
- string post = Console.ReadLine();
- string[] variables = post.Split('&');
- string cakeName = variables[0].Split('=')[1];
- string cakePrice = variables[1].Split('=')[1];
- File.AppendAllText("database.csv", $"{cakeName}, {cakePrice}" + Environment.NewLine);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment