소년포비의 세계정복!!

[ASP.NET] 래퍼체크 로직 본문

프로그램 세상/ASP.NET

[ASP.NET] 래퍼체크 로직

소년포비 2009. 10. 24. 02:13

if (Request.UrlReferrer == null)
                        {
                                Response.Redirect ("list.aspx");
                        }
                        else
                        {
                                string refer = Request.UrlReferrer.ToString ();
                                string ServerPath = Request.Url.ToString ();

                                ServerPath = ServerPath.Substring (0, ServerPath.LastIndexOf ("/"));

                                if (refer.IndexOf (ServerPath) == -1)
                                        Response.Redirect ("list.aspx");
                        }