以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 发布后的项目打开很慢,怎么办? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=48871) |
-- 作者:xvkewen -- 发布时间:2014/4/7 22:24:00 -- 发布后的项目打开很慢,怎么办? 我用开发版将我开发的程序发布出来后,打开的速度简直超慢,首次打开慢也就算了,后面再打开还是很慢,应该怎样来优化呢? 有商业版或试用版,打开的时间为1分种左右; 用开发版首次打开的时间为10分左右,再次打开的时间为4—5分钟,这也太慢了,请大师们支支招,怎么针对打开速度来进行优化呢?
|
-- 作者:e-png -- 发布时间:2014/4/7 22:30:00 -- 先看看电脑配置吧,不要太老旧的电脑了。 |
-- 作者:程兴刚 -- 发布时间:2014/4/7 22:31:00 -- 怎么支招法? |
-- 作者:xvkewen -- 发布时间:2014/4/7 22:40:00 -- 你们发布的程序不会也打开这么慢吧?如果要提高程序的运行速度,可以从哪些方面入手去优化呢? |
-- 作者:jspta -- 发布时间:2014/4/7 22:55:00 -- 应该是网络问题吧,还有就是机器比较老,你项目打开加载的数据可能太多了,比如数十万行等,具体原因要看你的项目了 |
-- 作者:e-png -- 发布时间:2014/4/7 22:56:00 -- 加载的数据要尽量的少,beforeopenprojiect 中的代码要简略···· |
-- 作者:xvkewen -- 发布时间:2014/4/7 23:08:00 -- 1、请看以下电脑配置,应该也不算差了吧; 2、加载的数据最多也不会超过2万行; 3、Beforeopenproject事件中也没有任何代码;
|
-- 作者:e-png -- 发布时间:2014/4/7 23:33:00 -- 另外,启动后随项目开启的必须打开的窗口要简单些(按钮少、代码简)。 |
-- 作者:xvkewen -- 发布时间:2014/4/7 23:45:00 -- 以下是我AfterOpenproject事件中的代码,好像也没有太耗时的代码吧! \'开启全局表的KEYDOWN事件 For Each dt As DataTable In DataTables dt.GlobalHandler.KeyDown = True Next \'打开用户登录窗口 Forms("Login").show() \'对开发者以外的其他用户隐藏表标题; Dim dtb As new DataTableBuilder("finished_sample","已完成样办") dtb.Build() If User.Type <> UserTypeEnum.Developer Then For Each dt As Table In Tables If dt.Name <> "scheduling" And dt.Name <> "finished_sample" Then dt.Visible = False End If Next End If \'自动判断当前用户的角色,并筛选指定的内容显示; Dim dr As DataRow = DataTables("User_info").Find("User_Name= \'" & _username & "\'") \'分开查询,防注入登录 If dr IsNot Nothing Then Select Case _Userroles Case "QA","QAM" DataTables("scheduling").LoadFilter= "[QA_team] = \'" & _usergroup & "\' and ( [sample_state] <> \'已出办\' and [sample_state] <> \'取消\' ) " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() If _usergroup = "GD2" Then Tables("scheduling").setcolvisiblewidth("input_date|115|Season|100|series|100|Customer|95|Inside_SRS|90|SRS_No|100|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115") Else Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|SRS_No|100|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115") End If With Tables("scheduling") Dim i As Integer i = .FindRow("PA_feedback IS NULL and 排单顺序 < #" & Cdate(Date.Today) & "# and Follow_QA = \'" & dr("FullName") & "\'" ) If i >= 0 Then Forms("Updating").show End If End With \' ***************************** Case "PA" RibbonTabs("Sample_Manage").Visible = False DataTables("scheduling").LoadFilter= "[Sewing_Team] = \'" & _usergroup & "\' and ( [sample_state] <> \'已出办\' and [sample_state] <> \'取消\' ) " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() \' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作 Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115") With Tables("scheduling") Dim i As Integer i = .FindRow("PA_feedback is not null and 排单顺序 < #" & Cdate(Date.Today) & "# and Sewing_Team = \'" & dr("user_group") & "\'" ) If i >= 0 Then Forms("Updating").show End If End With \' ***************************** Case "PAM" RibbonTabs("Sample_Manage").Visible = False DataTables("scheduling").LoadFilter= " [sample_state] <> \'已出办\' and [sample_state] <> \'取消\' " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115") Case "纸样经理" RibbonTabs("Sample_Manage").Visible = False DataTables("scheduling").LoadFilter= "[PttnType] <> \'已有纸样\' and [PttnState] <> \'已完成\' and [sample_state] <> \'取消\' " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() \' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作 Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Mold_ID|100|cup_style|100|patten_ID|100|Pattener|60|PttnType|60|PttnFinishDate|115|PttnState|100|Follow_QA|60|Sewing_Team|50|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115") With Tables("scheduling") Dim i As Integer i = .FindRow("PttnState <> \'已完成\' And PttnFinishDate < #" & Cdate(Date.Today) & "# and PttnFinishDate is not null " ) If i >= 0 Then Forms("Updating").show End If End With Case "定型经理" RibbonTabs("Sample_Manage").Visible = False DataTables("scheduling").LoadFilter= "[CupType] <> \'无需做棉杯\' and [Cupstate] <> \'已完成\' and CupTeam like \'%定型%\' and [sample_state] <> \'取消\' " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() \' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作 Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|product_type|50|Mold_ID|100|cup_style|100|CupType|60|Cupstate|100|CupTeam|100|Cup_readydate|115|Follow_QA|60|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115") With Tables("scheduling") Dim i As Integer i = .FindRow("Cupstate <> \'已完成\' And Cup_readydate < #" & Cdate(Date.Today) & "# and Cup_readydate is not null " ) If i >= 0 Then Forms("Updating").show End If End With Case "FCQA" RibbonTabs("Sample_Manage").Visible = False DataTables("scheduling").LoadFilter= "[CupType] <> \'无需做棉杯\' and [CupTeam] like \'*FC*\' " DataTables("scheduling").LoadOrder= "[排单顺序]" DataTables("scheduling").Load() \' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作 Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|product_type|50|Mold_ID|100|cup_style|100|CupType|60|Cupstate|100|CupTeam|100|Cup_readydate|115|Follow_QA|60|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115") With Tables("scheduling") Dim i As Integer i = .FindRow("Cupstate <> \'已完成\' And Cup_readydate < #" & Cdate(Date.Today) & "# and Cup_readydate is not null " ) If i >= 0 Then Forms("Updating").show End If End With End Select MainTable = Tables("scheduling") Tables("scheduling").Sort = "排单顺序" End If |
-- 作者:Bin -- 发布时间:2014/4/8 8:24:00 -- 检查一下是否这个问题http://www.foxtable.com/help/topics/2730.htm |