找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 3674|回复: 2

[资料] U872源代码分析笔记1

[复制链接]
发表于 2013-3-3 16:31:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
本帖最后由 cpmodel 于 2013-3-6 10:11 编辑

位于C:\U8SOFT\Portal\USNPASink.dll中,EnterprisePortal.exe调用USNPASink中NPASink类的Startup方法!至于如何调用的,因为
EnterprisePortal.exe是VB写的,好像目前没有工具可以把VB的代码反编译!
  1. public bool Startup(IntPtr owner)
  2. {
  3. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(NPASink.CurrentDomain_UnhandledException);
  4. Application.ThreadException += new ThreadExceptionEventHandler(NPASink.Application_ThreadException);
  5. int hMutex = JOI.EnterInst();
  6. if (hMutex == 0)
  7. {
  8. if (MessageBox.Show(SR.GetString("s.singleinst"), SR.GetString("s.portal"), MessageBoxButtons.YesNo) == DialogResult.No)
  9. {
  10. goto Label_0242;
  11. }
  12. SR.Reset();
  13. ProcessUtils.TerminateProcess("EnterprisePortal");
  14. }
  15. ProcessUtils.TerminateProcess(new string[] { "EnterprisePortal" });
  16. IWin32Window splashWindow = null;
  17. try
  18. {
  19. string str;
  20. try
  21. {
  22. Application.SetCompatibleTextRenderingDefault(false);
  23. }
  24. catch (Exception exception)
  25. {
  26. DBG.DbgTrace(exception.ToString(), new object[0]);
  27. }
  28. this.mfa = new EplAdvisor(owner, hMutex);
  29. this.mfa.ApplicationSwitch.Parse(Environment.GetCommandLineArgs());
  30. PortalActionFactory.PortalAdvisor = this.mfa;
  31. DBG.DbgTrace("Begin login...", new object[0]);
  32. if (!PortalActionFactory.login(this.mfa, out str))
  33. {
  34. goto Label_0242;
  35. }
  36. Application.Idle += new EventHandler(this.Application_Idle);
  37. DBG.DbgTrace("login succeeded!", new object[0]);
  38. this.splash = new SplashScreen();
  39. this.splash.ShowSplach(true);
  40. splashWindow = this.splash.SplashWindow;
  41. this.mfa.InitBarAdvisors();
  42. Form mainForm = PlatformUI.CreateMainFrame(this.mfa).Form;
  43. mainForm.Shown += new EventHandler(this.mainForm_Shown);
  44. PortalActionFactory.InitScenarioActions(this.mfa);
  45. this.mfa.FireInitialized();
  46. PortalActionFactory.loginvbcontext(this.mfa.Login);
  47. PortalActionFactory.DisplayDefaultShowScenario(this.mfa);
  48. PortalActionFactory.TaskManagerInit(this.mfa);
  49. if (owner == IntPtr.Zero)
  50. {
  51. Application.Run(mainForm);
  52. }
  53. else
  54. {
  55. WindowWrap wrap = new WindowWrap(owner);
  56. mainForm.Show(wrap);
  57. }
  58. }
  59. catch (DACException exception2)
  60. {
  61. MessageBox.Show(splashWindow, exception2.Message, SR.GetString("s.infoPromptingDialogue"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  62. goto Label_0242;
  63. }
  64. catch (Exception exception3)
  65. {
  66. MessageBox.Show(exception3.ToString(), "UFIDA ERP-U8");
  67. goto Label_0242;
  68. }
  69. return true;
  70. Label_0242:
  71. NativeMethods.PostMessage(owner, 0x10, 0L, 0L);
  72. return false;
  73. }




复制代码
调用登录界面!
  1. if (!PortalActionFactory.login(this.mfa, out str))
  2. {
  3. goto Label_0242;
  4. }
复制代码
这个闪屏界面
  1. this.splash = new SplashScreen();
  2. this.splash.ShowSplach(true);
  3. splashWindow = this.splash.SplashWindow;
复制代码
下面几句是生成主界面以及工具栏,菜单栏。
  1. Form mainForm = PlatformUI.CreateMainFrame(this.mfa).Form;
  2. mainForm.Shown += new EventHandler(this.mainForm_Shown);
  3. PortalActionFactory.InitScenarioActions(this.mfa);
  4. this.mfa.FireInitialized();
复制代码
这句代码是生成业务导航视图和信息中心,关键代码啊
  1. PortalActionFactory.DisplayDefaultShowScenario(this.mfa);
复制代码
工具有:Reflector,FileDisassembler插件,VS2005.
用Reflector反编译那些DLL文件,用FileDisassembler插件生成源代码,再用VS2005添加这些源代码修改代码后,再重新编译成DLL文件放到原先的地方!这样你就可以看到修改后的效果了!
发表于 2014-6-24 19:12:13 | 显示全部楼层
用Reflector反编译那些DLL文件,用FileDisassembler插件生成源代码
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-5-16 11:43 , Processed in 0.036112 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表