public void ProcessRequest(HttpContext context)
        {
            try
            {
                string          senderid = context.Request.Form["senderid"];
                page_mantain_DB mypage   = new page_mantain_DB();
                Email           myEmail  = new Email();

                DataTable dt                 = mypage.GetReSendMail(senderid);
                string    subject            = "[ITRI] 通知:您有來自工研院大檔案傳輸的信件";
                string    to                 = dt.Rows[0]["sender_mail"].ToString().Trim();
                DataTable ReturnSenderNameDT = Common.GetDetail(dt.Rows[0]["main_infno"].ToString().Trim(), dt.Rows[0]["main_isempno"].ToString().Trim());
                string    ReturnSenderName   = ReturnSenderNameDT.Rows[0]["cName"].ToString().Trim();
                string    returnsendercEmail = ReturnSenderNameDT.Rows[0]["cEmail"].ToString().Trim();

                string fileList = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    fileList += dt.Rows[i]["ShowFileName"].ToString() + dt.Rows[i]["afile_exten"].ToString() + "<br />";
                }

                StringBuilder sbBody = new StringBuilder();
                sbBody.Append(@"<html><head><title></title><style type='text/css'>DIV.PlainText {FONT-FAMILY: monospace; FONT-SIZE: 120%}</style></head>");
                sbBody.Append(@"<body><font size='2'>");
                sbBody.Append(@"<div class='PlainText'>");
                sbBody.Append(@"親愛的朋友 您好:<br />");
                sbBody.Append(@"<br />");
                sbBody.AppendFormat(@"{0} &lt;{2}&gt; 先生/小姐,在 {1}寄送下列的檔案給您。", ReturnSenderName, dt.Rows[0]["cmain_createdate"].ToString().Trim(), returnsendercEmail);
                sbBody.Append(@"請您利用下面的網址來下載檔案,謝謝您!<br /><br />※ 所有的檔案將在 7 天後刪除※");
                sbBody.Append(@"<br /><br />訊息留言:<br />");
                sbBody.AppendFormat(@"{0}", dt.Rows[0]["main_desc"].ToString());
                sbBody.Append(@"<br />");
                sbBody.Append(@"檔案列表:<br />");
                sbBody.Append(@"" + fileList + "");

                if (dt.Rows[0]["main_secret"].ToString() == "security")
                {
                    sbBody.Append(@"取檔認證碼:<br />如為密件檔案,請在下載時輸入圖片內之數字,即會再寄一封解壓縮密碼給您。<br />");
                    sbBody.Append(@"<img alt='認證碼' src='cid:attech01.jpg' /><br />");
                }
                sbBody.Append(@"取檔網址:<br />");
                sbBody.Append(@"※ 1. 如果有「安全性警示」的視窗跳出,請按「是」接受以繼續接收檔案<br />");
                sbBody.Append(@"※ 2. 此加密取檔網址為您所獨有,若需要轉寄信件時,請務必留意:系統將所有透過此網址取檔者均視同已取得您本人同意。<br />");
                sbBody.Append(@"<a href='" + AppConfig.MailUrl + "Veryfly.aspx?en=" + dt.Rows[0]["sender_querystring"].ToString() + "' target='_blank'>" + AppConfig.MailUrl + "Veryfly.aspx?en=" + dt.Rows[0]["sender_querystring"].ToString() + "</a><br />");//pathUrl("MailUrl") + "Veryfly.aspx?en=" + dt.Rows[i]["sender_querystring"].ToString(), pathUrl("MailUrl") + "Veryfly.aspx?en=" + dt.Rows[i]["sender_querystring"].ToString()
                sbBody.Append(@"====================================================================<br />");
                sbBody.Append(@"本信件可能包含工研院機密資訊,非指定之收件者,請勿使用或揭露本信件內容,並請銷毀此信件。<br />");
                sbBody.Append(@"This email may contain confidential information. Please do not use or disclose ");
                sbBody.Append(@"it in any way and delete it if you are not the intended recipient.</div>");
                sbBody.Append(@"</font></body></html>");
                //sbBody.AppendFormat(@"");

                myEmail.sendEmail(to, "", subject, sbBody.ToString(), dt.Rows[0]["sender_imagetext"].ToString(), returnsendercEmail);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string          senderid = context.Request.Form["senderid"];
                page_mantain_DB mypage   = new page_mantain_DB();
                Email           myEmail  = new Email();

                DataTable dt                 = mypage.GetReSendMail(senderid);
                string    subject            = "[ITRI] Notification from ITRI WebFTP - You have a file send by your partner";
                string    to                 = dt.Rows[0]["sender_mail"].ToString().Trim();
                DataTable ReturnSenderNameDT = Common.GetDetail(dt.Rows[0]["main_infno"].ToString().Trim(), dt.Rows[0]["main_isempno"].ToString().Trim());
                string    ReturnSenderName   = ReturnSenderNameDT.Rows[0]["cName"].ToString().Trim();
                string    returnsendercEmail = ReturnSenderNameDT.Rows[0]["cEmail"].ToString().Trim();

                string fileList = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    fileList += dt.Rows[i]["ShowFileName"].ToString() + dt.Rows[i]["afile_exten"].ToString() + "<br />";
                }

                StringBuilder sbBody = new StringBuilder();
                sbBody.Append(@"<html><head><title></title><style type='text/css'>DIV.PlainText {FONT-FAMILY: monospace; FONT-SIZE: 120%}</style></head>");
                sbBody.Append(@"<body><font size='2'>");
                sbBody.Append(@"<div class='PlainText'>");
                sbBody.Append(@"Dear:<br />");
                sbBody.Append(@"<br />");
                sbBody.AppendFormat(@"{0} &lt;{2}&gt;  had send some files to you at  {1}.", ReturnSenderName, dt.Rows[0]["cmain_createdate"].ToString().Trim(), returnsendercEmail);
                sbBody.Append(@"Please download your files as soon as possible.<br /><br />※ All files will be deleted in 7 Days ※");
                sbBody.Append(@"<br /><br />Messages:<br />");
                sbBody.AppendFormat(@"{0}", dt.Rows[0]["main_desc"].ToString());
                sbBody.Append(@"<br />");
                sbBody.Append(@"File List:<br />");
                sbBody.Append(@"" + fileList + "");

                if (dt.Rows[0]["main_secret"].ToString() == "security")
                {
                    sbBody.Append(@"authentication code:<br />If it is security file,Please enter the number in the CAPTCHA when you download. We will send you another mail with a password for you to unzip the file(s).<br /><br />");
                    sbBody.Append(@"<img alt='認證碼' src='cid:attech01.jpg' /><br />");
                }
                sbBody.Append(@"Download URL:<br />");
                sbBody.Append(@"* 1. If any 'Security Alert' windows pop up, please proceed by clicking 'Yes'.<br />");
                sbBody.Append(@"* 2. This encoded URL is for YOU ONLY.<br />");
                sbBody.Append(@"We will consider everyone accessing this URL having your approval.<br />Please confirm before you forward this e-mail.<br />");
                sbBody.Append(@"<a href='" + AppConfig.MailUrl + "enVersion/VeryflyEn.aspx?en=" + dt.Rows[0]["sender_querystring"].ToString() + "' target='_blank'>" + AppConfig.MailUrl + "enVersion/VeryflyEn.aspx?en=" + dt.Rows[0]["sender_querystring"].ToString() + "</a><br />");//pathUrl("MailUrl") + "Veryfly.aspx?en=" + dt.Rows[i]["sender_querystring"].ToString(), pathUrl("MailUrl") + "Veryfly.aspx?en=" + dt.Rows[i]["sender_querystring"].ToString()
                sbBody.Append(@"====================================================================<br />");
                sbBody.Append(@"This email may contain confidential information. Please do not use or disclose ");
                sbBody.Append(@"it in any way and delete it if you are not the intended recipient.</div>");
                sbBody.Append(@"</font></body></html>");
                //sbBody.AppendFormat(@"");

                myEmail.sendEmail(to, "", subject, sbBody.ToString(), dt.Rows[0]["sender_imagetext"].ToString(), returnsendercEmail);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string          parentid = string.IsNullOrEmpty(context.Request.Form["parentid"]) ? "" : context.Request.Form["parentid"].ToString().Trim();
                string          imgid    = string.IsNullOrEmpty(context.Request.Form["imgid"]) ? "" : context.Request.Form["imgid"].ToString().Trim();
                Guid            query    = new Guid(parentid);
                page_mantain_DB mypage   = new page_mantain_DB();

                if (imgid.ToString().Trim() == "fileOpen")
                {
                    DataTable       dt    = mypage.GetfileList(parentid);
                    List <TooLFile> eList = new List <TooLFile>();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        TooLFile e = new TooLFile();
                        e.id        = dt.Rows[i]["afile_id"].ToString().Trim();
                        e.fileName  = dt.Rows[i]["ShowFileName"].ToString() + dt.Rows[i]["afile_exten"].ToString();
                        e.stat      = dt.Rows[i]["afile_stat"].ToString().Trim();
                        e.main_stat = dt.Rows[i]["main_stat"].ToString().Trim();
                        eList.Add(e);
                    }

                    System.Web.Script.Serialization.JavaScriptSerializer objSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                    string ans = objSerializer.Serialize(eList);  //new
                    context.Response.ContentType = "application/json";
                    context.Response.Write(ans);
                }

                if (imgid.ToString().Trim() == "senderOpen")
                {
                    DataTable         dt    = mypage.GetsenderList(parentid);
                    List <TooLSender> eList = new List <TooLSender>();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        TooLSender e = new TooLSender();
                        e.id          = dt.Rows[i]["sender_id"].ToString().Trim();
                        e.email       = dt.Rows[i]["sender_mail"].ToString().Trim();
                        e.trytimes    = dt.Rows[i]["hitCount"].ToString().Trim() == "" ? "0" : dt.Rows[i]["hitCount"].ToString().Trim();
                        e.lasttrydate = dt.Rows[i]["LastDownDate"].ToString().Trim();
                        e.queryenable = dt.Rows[i]["sender_queryenable"].ToString().Trim();
                        e.main_stat   = dt.Rows[i]["main_stat"].ToString().Trim();
                        eList.Add(e);
                    }

                    System.Web.Script.Serialization.JavaScriptSerializer objSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                    string ans = objSerializer.Serialize(eList);  //new
                    context.Response.ContentType = "application/json";
                    context.Response.Write(ans);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#4
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string nameType = string.IsNullOrEmpty(context.Request.Form["nameType"]) ? "" : context.Request.Form["nameType"].ToString().Trim();
                string id       = string.IsNullOrEmpty(context.Request.Form["id"]) ? "" : context.Request.Form["id"].ToString().Trim();
                string value    = string.IsNullOrEmpty(context.Request.Form["value"]) ? "" : context.Request.Form["value"].ToString().Trim();

                if (encode.sqlInjection(id) || encode.sqlInjection(value) || encode.sqlInjection(nameType))
                {
                    throw new Exception("參數包含不合法字元");
                }

                page_mantain_DB mypage = new page_mantain_DB();
                mypage.GetchkboxStat(id, nameType, value);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        protected void gvmainlist_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Cells[0].Visible = false;
                e.Row.Cells[1].Visible = false;
                e.Row.Cells[2].Visible = false;
                e.Row.Cells[3].Visible = false;
                e.Row.Cells[4].Visible = false;

                page_mantain_DB mypage = new page_mantain_DB();
                //檔案列表清單
                Panel              panelFile = (Panel)e.Row.Cells[7].FindControl("panelfile");
                DataTable          dtFile    = mypage.GetfileList(e.Row.Cells[2].Text);
                HtmlGenericControl span      = new HtmlGenericControl("span");
                span.Attributes.Add("class", "font-size2 underlineClass");
                HtmlGenericControl table = new HtmlGenericControl("table");
                table.Attributes.Add("width", "100%");
                table.Attributes.Add("cellpadding", "0");
                table.Attributes.Add("cellspacing", "0");
                table.Attributes.Add("class", "OpenUpTable");

                if (dtFile.Rows.Count > 0)
                {
                    for (int i = 0; i < dtFile.Rows.Count; i++)
                    {
                        HtmlGenericControl tr = new HtmlGenericControl("tr");
                        HtmlGenericControl td = new HtmlGenericControl("td");
                        td.Attributes.Add("width", "20px");
                        td.Attributes.Add("style", "font-weight:bold");
                        td.InnerText = (i + 1).ToString();
                        HtmlGenericControl td2 = new HtmlGenericControl("td");
                        td2.InnerText = dtFile.Rows[i]["ShowFileName"].ToString().Trim() + dtFile.Rows[i]["afile_exten"].ToString().Trim();
                        tr.Controls.Add(td);
                        tr.Controls.Add(td2);
                        table.Controls.Add(tr);
                    }
                }

                span.Controls.Add(table);
                panelFile.Controls.Add(span);


                //收件人清單
                Panel              panelsender = (Panel)e.Row.Cells[7].FindControl("panelsender");
                DataTable          dtsender    = mypage.GetsenderList(e.Row.Cells[2].Text);
                HtmlGenericControl spansender  = new HtmlGenericControl("span");
                spansender.Attributes.Add("class", "font-size2 underlineClass");
                HtmlGenericControl tablesender = new HtmlGenericControl("table");
                tablesender.Attributes.Add("width", "100%");
                tablesender.Attributes.Add("cellpadding", "0");
                tablesender.Attributes.Add("cellspacing", "0");
                tablesender.Attributes.Add("class", "OpenUpTable");

                if (dtsender.Rows.Count > 0)
                {
                    for (int i = 0; i < dtsender.Rows.Count; i++)
                    {
                        HtmlGenericControl tr = new HtmlGenericControl("tr");
                        HtmlGenericControl td = new HtmlGenericControl("td");
                        td.Attributes.Add("width", "40%");
                        td.InnerText = dtsender.Rows[i]["sender_mail"].ToString().Trim();
                        HtmlGenericControl td2 = new HtmlGenericControl("td");
                        td2.Attributes.Add("width", "20%");
                        string hitcount = dtsender.Rows[i]["hitCount"].ToString().Trim() == "" ? "0" : dtsender.Rows[i]["hitCount"].ToString().Trim();
                        td2.InnerText = "嘗試下載" + hitcount + "次";
                        HtmlGenericControl td3 = new HtmlGenericControl("td");
                        td3.Attributes.Add("width", "39%");
                        td3.InnerText = "最近一次" + dtsender.Rows[i]["LastDownDate"].ToString().Trim();

                        tr.Controls.Add(td);
                        tr.Controls.Add(td2);
                        tr.Controls.Add(td3);
                        tablesender.Controls.Add(tr);
                    }
                }

                spansender.Controls.Add(tablesender);
                panelsender.Controls.Add(spansender);
            }

            if (e.Row.RowType == DataControlRowType.Header)
            {
                e.Row.Cells[0].Visible = false;
                e.Row.Cells[1].Visible = false;
                e.Row.Cells[2].Visible = false;
                e.Row.Cells[3].Visible = false;
                e.Row.Cells[4].Visible = false;
            }
        }