Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {

                conn = new Connection();
                string connectionstring = ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString;
                conn.Open(connectionstring);
                Message = Request["Message"];
               UserIPAddress = GetIPAddress();
                //For Demo
                // UserIPAddress = "192.168.1.12";
                Rs1 = new Recordset();
                sql1 = "Select Station From Station Where IPAddress ='" + UserIPAddress + "'";
                Rs1 = conn.Execute(sql1);
                if (!(Rs1.Eof))
                {
                    StationID = Rs1.Fields["Station"].Value;
                    Session["StationID"] = StationID;
                    conn.Close();
                }
                else
                {
                    Alert = "編號未設置, 請提供此電腦的 IP 地址 [ " + UserIPAddress + " ] 給系統管理員";
                }
            }
            catch (Exception ex)
            {

            }
        }