<%@ WebHandler Language="C#" Class="Kernel" %> using System; using System.Collections.Generic; using System.Web; using System.Data; using System.Data.Common; using System.Web.SessionState; using System.Text; using eMIS; using System.IO; public class Kernel : IHttpHandler , IRequiresSessionState { public void ProcessRequest (HttpContext context) { if (context.Session["userid"]==null) context.Response.End(); string wwwroot = context.Request.ApplicationPath; if (wwwroot == "/") wwwroot = ""; string s = context.Request["json"].ToString(); string userId = context.Session["userid"].ToString(); string programId = context.Request["pid"].ToString(); string path = wwwroot + "/App_Files/profiles/" + programId; path = context.Server.MapPath(path); if (!Directory.Exists(path)) Directory.CreateDirectory(path); path +="\\"+userId+".js"; System.IO.File.WriteAllText(path, s,Encoding.UTF8); context.Response.Write("ok"); } public bool IsReusable { get { return false; } } }