public void ProcessRequest(HttpContext context) { string strResponse = "false"; PostClass PostClass = new Common.CommonClass.PostClass(); PostClass.PostData = context.Request["PostData"]; string[] dynamicPaths = Common.NewtonJsonHelper.Deserialize <string[]>(PostClass.PostData, null); try { foreach (string dynamicPath in dynamicPaths) { string fileDirectory = HttpContext.Current.Server.MapPath("~/") + dynamicPath.ToString(); if (File.Exists(fileDirectory)) { File.Delete(fileDirectory); } } strResponse = "true"; } catch (Exception ex) { strResponse = "false"; } context.Response.ContentType = "text/plain"; context.Response.Write(strResponse); }
public bool ChangePwdUpdate(Common.CommonClass.PostClass PostClass) { dynamic param = Common.NewtonJsonHelper.Deserialize <dynamic>(PostClass.PostData.ToString(), null); string userOID = param.userOID.ToString(); string oldPwd = param.oldPwd.ToString(); string newPwd = param.newPwd.ToString(); return(_authBll.ChangePwd(userOID, oldPwd, newPwd)); }
public void ProcessRequest(HttpContext context) { string strResponse = "false"; PostClass PostClass = new Common.CommonClass.PostClass(); PostClass.PostData = context.Request["PostData"]; dynamic dynamic = Common.NewtonJsonHelper.Deserialize<dynamic>(PostClass.PostData, null); string filePath = HttpContext.Current.Server.MapPath("~/") + dynamic.filepath.ToString(); string extendName = filePath.Split('.')[filePath.Split('.').Length - 1]; string htmlPath = HttpContext.Current.Server.MapPath("~/") + dynamic.htmlpath.ToString(); if (extendName == "doc" || extendName == "docx") { strResponse = WordToHtml(filePath, htmlPath) ? "true" : "false"; } else if (extendName == "xls" || extendName == "xlsx") { strResponse = ExcelToHtml(filePath, htmlPath) ? "true" : "false"; } context.Response.ContentType = "text/plain"; context.Response.Write(strResponse); }