Files
NKC/NKC_WF/getDynCss.aspx.cs
T
2019-09-16 12:39:56 +02:00

34 lines
914 B
C#

using System;
using System.IO;
namespace NKC_WF
{
public partial class getDynCss : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// retitusico un CSS continuamente aggiornato...
Response.Clear();
string filename = Server.MapPath("~/Content/SheetColor.css");
string answ = File.ReadAllText(filename);
// rendo dinamico in base al secondo pari/dispari il mio #IT00006
int secondi = DateTime.Now.Second;
if (secondi % 2 == 0)
{
answ += "#IT000006 {fill: orange;}";
answ += "#IT000003 {fill: orange; .flashStroke; .strokeThick;}";
}
else
{
answ += "#IT000006 {fill: blue;}";
answ += "#IT000003 {fill: blue; .flashStroke; .strokeThick;}";
}
Response.ContentType = "text/css";
Response.Write(answ);
Response.Flush();
Response.End();
}
}
}