Sunday, February 10, 2013

Is it possible to secure swf files?


1- Obfuscate your ActionScript using an advanced obfuscator such as secureSWF.
2- Domain lock your SWF files.
3- Create a dummy loader, rename the original SWF files and change their extension, then load the original SWF files using the dummy loader.
4- Make sure to prevent hot linking. (this will depend on your web server)
5- Encrypt sensitive strings in your ActionScript; either manually in your code, or you can also use secureSWF for that.

Friday, February 8, 2013

Crystal Report Dynamically Binding


   protected void cmdPreview_Click(object sender, EventArgs e)
        {
            try {
                if (txtfrmDate.Text == "") { WebMsgBox.Show("From date must requir...."); return; }
                if (txtToDate.Text == "") { WebMsgBox.Show("to date must requir ...."); return; }

                UserInfo.cRptTag = "RoasterdetailRpt";
                UserInfo.crptDepartmentID = DDLDept.SelectedValue;
                UserInfo.crptDateFrom = txtfrmDate.Text.Trim().Substring(6, 4) + '-' + txtfrmDate.Text.Trim().Substring(3, 2) + '-' + txtfrmDate.Text.Trim().Substring(0, 2);
                UserInfo.crptDateTo = txtToDate.Text.Trim().Substring(6,4)+'-'+txtToDate.Text.Trim().Substring(3,2)+'-'+txtToDate.Text.Trim().Substring(0,2) ;
                //Response.Redirect("/frmViewer.aspx");
                RptViewer.RefreshReport();
                ReportDocument rd = new ReportDocument();
                string strRptPath = System.Web.HttpContext.Current.Server.MapPath("~/Reports/CrossTabbedAttendanceFinal4.rpt");

                //qry = "  Select Code,Name,Description,LeaveMode,UnitType,Quantity " +
                //        "  from tblLeaveType  " +
                //        "  Where (companyID=" + UserInfo.cCompanyCode + ")";


                string qry = "exec Generate_RosterDepartmentWise '" + UserInfo.crptDepartmentID + "' ,'" + UserInfo.crptDateFrom + "' ,'" + UserInfo.crptDateTo + "'";

                tbl = db.GetTableToSql(qry, "x");
                rd.Load(strRptPath);
                rd.SetDataSource(tbl);

                RptViewer.ReportSource = rd;
                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();
                RptViewer.RefreshReport();


            }
            catch (Exception x) { WebMsgBox.Show(x.Message); }
        }