Esempio n. 1
0
        public static bool IsQueryString(string strQuery, string Q)
        {
            bool result = false;

            if (!(Q == "N"))
            {
                if (Q == "S" && HttpContext.Current.Request.QueryString[strQuery] != null && HttpContext.Current.Request.QueryString[strQuery].ToString() != string.Empty)
                {
                    result = true;
                }
            }
            else if (HttpContext.Current.Request.QueryString[strQuery] != null && PicRar.IsNumeric(HttpContext.Current.Request.QueryString[strQuery].ToString()))
            {
                result = true;
            }
            return(result);
        }
Esempio n. 2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         string virtualPath = string.Empty;
         int    maxWidth    = 0;
         int    maxHeight   = 0;
         if (PicRar.IsQueryString("P", "S"))
         {
             virtualPath = base.Request.QueryString["P"];
         }
         if (PicRar.IsQueryString("W"))
         {
             maxWidth = int.Parse(base.Request.QueryString["W"]);
         }
         if (PicRar.IsQueryString("H"))
         {
             maxHeight = int.Parse(base.Request.QueryString["H"]);
         }
         if (virtualPath != string.Empty)
         {
             PIC pic = new PIC();
             if (!virtualPath.StartsWith("/"))
             {
                 virtualPath = "/" + virtualPath;
             }
             virtualPath = Globals.ApplicationPath + virtualPath;
             pic.SendSmallImage(base.Request.MapPath(virtualPath), maxHeight, maxWidth);
             string watermarkFilename      = base.Request.MapPath(Globals.ApplicationPath + "/Admin/images/watermark.gif");
             System.IO.MemoryStream stream = pic.AddImageSignPic(pic.OutBMP, watermarkFilename, 9, 60, 4);
             pic.Dispose();
             base.Response.ClearContent();
             base.Response.ContentType = "image/gif";
             base.Response.BinaryWrite(stream.ToArray());
             base.Response.End();
             stream.Dispose();
         }
     }
     catch (System.Exception exception)
     {
         this.label_html = exception.Message;
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string text      = string.Empty;
         int    maxWidth  = 0;
         int    maxHeight = 0;
         if (PicRar.IsQueryString("P", "S"))
         {
             text = base.Request.QueryString["P"];
         }
         if (PicRar.IsQueryString("W"))
         {
             maxWidth = int.Parse(base.Request.QueryString["W"]);
         }
         if (PicRar.IsQueryString("H"))
         {
             maxHeight = int.Parse(base.Request.QueryString["H"]);
         }
         if (!(text == string.Empty))
         {
             PIC pIC = new PIC();
             if (!text.StartsWith("/"))
             {
                 text = "/" + text;
             }
             text = text;
             pIC.SendSmallImage(base.Request.MapPath(text), maxHeight, maxWidth);
             string       watermarkFilename = base.Request.MapPath("/Admin/images/watermark.gif");
             MemoryStream memoryStream      = pIC.AddImageSignPic(pIC.OutBMP, watermarkFilename, 9, 60, 4);
             pIC.Dispose();
             base.Response.ClearContent();
             base.Response.ContentType = "image/gif";
             base.Response.BinaryWrite(memoryStream.ToArray());
             base.Response.End();
             memoryStream.Dispose();
         }
     }
     catch (Exception ex)
     {
         this.label_html = ex.Message;
     }
 }
Esempio n. 4
0
        public static bool IsQueryString(string strQuery, string Q)
        {
            bool flag = false;
            bool result;

            if (Q != null)
            {
                if (!(Q == "N"))
                {
                    if (Q == "S" && System.Web.HttpContext.Current.Request.QueryString[strQuery] != null && System.Web.HttpContext.Current.Request.QueryString[strQuery].ToString() != string.Empty)
                    {
                        flag = true;
                    }
                    result = flag;
                    return(result);
                }
                if (System.Web.HttpContext.Current.Request.QueryString[strQuery] != null && PicRar.IsNumeric(System.Web.HttpContext.Current.Request.QueryString[strQuery].ToString()))
                {
                    flag = true;
                }
            }
            result = flag;
            return(result);
        }
Esempio n. 5
0
 public static bool IsQueryString(string strQuery)
 {
     return(PicRar.IsQueryString(strQuery, "N"));
 }