using System; using CoreSavingLibrary; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using DataLibrary; namespace Saving { public partial class Logout : System.Web.UI.Page { public String HM9ColorFilter { set; get; } public string url; protected void Page_Load(object sender, EventArgs e) { // สร้าง fullpath ของโฟลเดอร์ GCOOP String vDir = "IEXT"; Session["currentDir"] = HttpContext.Current.Request.MapPath("~/").Substring(0, 1); String gcoopPath = Session["currentDir"] + ":\\ICOOP_ALL\\" + vDir + "\\ICOOP\\"; // สร้าง object xml เป็นตัวแปร local XmlConfigService xml = new XmlConfigService(gcoopPath); HM9ColorFilter = xml.HM9ColorFilter; // ประกาศ web state WebState state = new WebState(); // พยายามลบ token id ในกรณีที่ยังไม่ได้ logout จริงๆ try { string connectionString = state.SsConnectionString; string tokenId = state.SsTokenId; if (!string.IsNullOrEmpty(connectionString) && !string.IsNullOrEmpty(tokenId)) { Sta ta = new Sta(connectionString); string sql = "delete from ssotoken where token_id = '" + tokenId + "'"; ta.Exe(sql); } } catch { } //string vDir = WebUtil.GetVirtualDirectory(); url= WebUtil.GetSavingUrl(); HyperLink1.NavigateUrl = url; Session.Abandon(); } } }