コード例 #1
0
 private void Page_Load(object sender, EventArgs e)
 {
     try
     {
         this.UserLocation = FireEagle.GetLocation(Context, Context.Request.Url);
     }
     catch (AuthorizationRequiredException authex)
     {
         Response.Redirect(authex.AuthorizationUri.AbsoluteUri);
     }
 }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                Location location = FireEagle.GetLocation(context, new Uri(context.Request.Url, context.Request.ApplicationPath));

                if (location != null)
                {
                    AjaxHelper.SendLocation(context, location);
                }
                else
                {
                    AjaxHelper.SendError(context, "Could not get location");
                }
            }
            catch (AuthorizationRequiredException authex)
            {
                AjaxHelper.SendAuthorizationRequired(context, authex);
            }
        }