ASP.NET 调用dephi的DLL,在IIS中通常一段时间后,页面无限加载中
ASP.NET 调用dephi的DLL,在IIS中正常一段时间后,页面无限加载中
ASP.NET 调用dephi写的DLL
可以正常一段时间,时间不固定,
然后就会出现某个用户打页面的时候无线等待 就是浏览器的圈圈一直转
我想知道 到底是我的ASP.NET 调用有问题 还是IIS设置有问题 ,还是DLL有问题了?
会不会是因为多个人同时调用DLL的时候出现问题了?
------解决思路----------------------
dll是否可以只load一次,
myPrintBills compile = (myPrintBills)ll.LoadFun("myPrintBills", typeof(myPrintBills));
函数映射是不是也只需要一次就可以?用的时候弄成单例,这个需要先考虑的
生成报表这个过程一般比较耗时的,所以你可以在
DataTable dt = FXOA.DBUtility.DbHelperSQL.GetDataTable(sql);
这一句前后加日志看看效率如何
ASP.NET 调用dephi写的DLL
可以正常一段时间,时间不固定,
然后就会出现某个用户打页面的时候无线等待 就是浏览器的圈圈一直转
我想知道 到底是我的ASP.NET 调用有问题 还是IIS设置有问题 ,还是DLL有问题了?
会不会是因为多个人同时调用DLL的时候出现问题了?
private void makeprintreport()
{
string constr = ConfigurationManager.ConnectionStrings["ERPConnectionString"].ConnectionString;
string[] arr = constr.Split(';');
string DataSource = arr[0].Substring(arr[0].IndexOf("=") + 1, arr[0].Length - arr[0].IndexOf("=") - 1);
string InitialCatalog = arr[1].Substring(arr[1].IndexOf("=") + 1, arr[1].Length - arr[1].IndexOf("=") - 1);
string TrueName = FXOA.Common.PublicMethod.GetSessionValue("TrueName");
string billno = Request.Params["billno"].ToString();
string opeid = Request.Params["opeid"].ToString();
string ereportfile = Request.Params["reportno"].ToString();
loaddll ll = new loaddll();
string[] name = { "cmpname", "userno", "opeid", "opetype", "opedate", "billno", "logdetail", "opdsdt" };
Object[] value = { "0报表打印开始装载myprint控件", TrueName, opeid, -3, DateTime.Now, "单据号:" + billno, "0报表打印开始装载myprint控件", DateTime.Now };
try
{
string dllpath = Server.MapPath("ReportDll/myprint.dll");
//对方法进行调用
string err = "";//(string) method.Invoke(o, param);//param为方法参数object数组
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
ll.LoadDll(dllpath);
value[0] = "1装载myprint控件完成调用打印方法";
value[6] = "1装载myprint控件完成调用打印方法";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
myPrintBills compile = (myPrintBills)ll.LoadFun("myPrintBills", typeof(myPrintBills));
err = compile(billno, TrueName, DataSource, InitialCatalog, opeid, ereportfile, billno).ToString();
value[0] = "2装载myprint调用打印方法完成";
value[6] = "2装载myprint调用打印方法完成";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
ll.UnLoadDll();
value[0] = "3卸载myprint(释放DLL完成,读取数据库)";
value[6] = "3卸载myprint(释放DLL完成,读取数据库)";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
if (err == "0")
{
this.ReportViewer1.LocalReport.EnableExternalImages = true;
this.ReportViewer1.LocalReport.ReportPath = @"PrintReport/OA_Report.rdlc";
string sql = string.Format("select autoid,billno,ddate,rpic,userno,'file:///'+picpath as picpath from xt_ereportoa where billno='{0}' and userno='{1}' ", billno, FXOA.Common.PublicMethod.GetSessionValue("TrueName"));
DataTable dt = FXOA.DBUtility.DbHelperSQL.GetDataTable(sql);
ReportDataSource rds = new ReportDataSource("DataSet1", dt);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.LocalReport.Refresh();
value[0] = "4myprint数据库读取完成";
value[6] = "4myprint数据库读取完成";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
}
else
{
Response.Write(" 打印不成功!错误代码:" + err + " ");
}
}
catch (Exception ex)
{
ll.UnLoadDll();
value[0] = "5myprint在CATCH中释放DLL完成";
value[6] = "5myprint在CATCH中释放DLL完成";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
Response.Write(ex.Message);
}
finally {
ll.UnLoadDll();
value[0] = "6myprint在finally中释放DLL完成";
value[6] = "6myprint在finally中释放DLL完成";
LfemporderManager.Insertlfdjorder(value, name, "xt_LogDailyOpes", "add");
}
}
------解决思路----------------------
dll是否可以只load一次,
myPrintBills compile = (myPrintBills)ll.LoadFun("myPrintBills", typeof(myPrintBills));
函数映射是不是也只需要一次就可以?用的时候弄成单例,这个需要先考虑的
生成报表这个过程一般比较耗时的,所以你可以在
DataTable dt = FXOA.DBUtility.DbHelperSQL.GetDataTable(sql);
这一句前后加日志看看效率如何