62 lines
1.3 KiB
C#
62 lines
1.3 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Http;
|
|
|
|
namespace NKC_WF.Controllers
|
|
{
|
|
public class getMUCssController : ApiController
|
|
{
|
|
// GET api/<controller>
|
|
public HttpResponseMessage Get()
|
|
{
|
|
string filename = HttpContext.Current.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;}";
|
|
}
|
|
|
|
//return answ;
|
|
|
|
|
|
return new HttpResponseMessage(HttpStatusCode.OK)
|
|
{
|
|
Content = new StringContent(answ, Encoding.UTF8, "text/css")
|
|
};
|
|
}
|
|
|
|
// GET api/<controller>/5
|
|
public string Get(int id)
|
|
{
|
|
return "value";
|
|
}
|
|
|
|
// POST api/<controller>
|
|
public void Post([FromBody]string value)
|
|
{
|
|
}
|
|
|
|
// PUT api/<controller>/5
|
|
public void Put(int id, [FromBody]string value)
|
|
{
|
|
}
|
|
|
|
// DELETE api/<controller>/5
|
|
public void Delete(int id)
|
|
{
|
|
}
|
|
}
|
|
} |