cpmodel 发表于 2013-2-13 22:50:12

U8UAP开发最好的辅助工具!

本帖最后由 cpmodel 于 2013-3-1 19:44 编辑

上次搞错了,应该是用友安装目录U8SOFT里面的EnterprisePortal.exe才对,不过这个程序是用VB写的,无法用Reflector打开,网上的VB反编译工具,不过可以得到EnterprisePortal.exe调用的模块,经过分析,可以肯定位于C:\U8SOFT\Portal文件夹中的USNPASink.dll就是用友ERP的进入点!EnterprisePortal.exe中的VB代码调用了USNPASink.dll中Startup方法,在这个方法中生成了我的用友ERP操作界面!public bool Startup(IntPtr owner)
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(NPASink.CurrentDomain_UnhandledException);
Application.ThreadException += new ThreadExceptionEventHandler(NPASink.Application_ThreadException);
int hMutex = JOI.EnterInst();
if (hMutex == 0)
{
if (MessageBox.Show(SR.GetString("s.singleinst"), SR.GetString("s.portal"), MessageBoxButtons.YesNo) == DialogResult.No)
{
goto Label_023E;
}
SR.Reset();
ProcessUtils.TerminateProcess("EnterprisePortal");
}
ProcessUtils.TerminateProcess(new string[] { "EnterprisePortal" });
IWin32Window splashWindow = null;
try
{
string str;
try
{
Application.SetCompatibleTextRenderingDefault(false);
}
catch (Exception exception1)
{
DBG.DbgTrace(exception1.ToString(), new object);
}
this.mfa = new EplAdvisor(owner, hMutex);
this.mfa.ApplicationSwitch.Parse(Environment.GetCommandLineArgs());
PortalActionFactory.PortalAdvisor = this.mfa;
DBG.DbgTrace("Begin login...", new object);
if (!PortalActionFactory.login(this.mfa, out str))
{
goto Label_023E;
}
Application.Idle += new EventHandler(this.Application_Idle);
DBG.DbgTrace("login succeeded!", new object);
this.splash = new SplashScreen();
this.splash.ShowSplach(true);
splashWindow = this.splash.SplashWindow;
this.mfa.InitBarAdvisors();
Form mainForm = PlatformUI.CreateMainFrame(this.mfa).Form;
mainForm.Shown += new EventHandler(this.mainForm_Shown);
PortalActionFactory.InitScenarioActions(this.mfa);
this.mfa.FireInitialized();
PortalActionFactory.loginvbcontext(this.mfa.Login);
PortalActionFactory.DisplayDefaultShowScenario(this.mfa);
PortalActionFactory.TaskManagerInit(this.mfa);
if (owner == IntPtr.Zero)
{
Application.Run(mainForm);
}
else
{
WindowWrap wrap = new WindowWrap(owner);
mainForm.Show(wrap);
}
}
catch (DACException exception2)
{
MessageBox.Show(splashWindow, exception2.Message, SR.GetString("s.infoPromptingDialogue"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
goto Label_023E;
}
catch (Exception exception4)
{
MessageBox.Show(exception4.ToString(), "UFIDA ERP-U8");
goto Label_023E;
}
return true;
Label_023E:
NativeMethods.PostMessage(owner, 0x10, 0L, 0L);
return false;
}




在Startup方面中生成登录界面的代码是;if (!PortalActionFactory.login(this.mfa, out str))
{
goto Label_023E;
}
生成闪屏的代码是:this.splash = new SplashScreen();
this.splash.ShowSplach(true);
splashWindow = this.splash.SplashWindowthis.mfa.InitBarAdvisors(); 这句代码生成了菜单栏,工具栏部分!
--------------------
PortalActionFactory.DisplayDefaultShowScenario(this.mfa);这句代码是重点,它负责生成业务导航视图,也就是左边的树部分,以及右边的消息中心!

在UFSystem数据库有两个表UA_ScenarioView和UA_View中可以找到左边的树业务导航视图是由UFIDA.U8.Portal.Viewers.OutlookNag.NavigationView负责生成的,其中用到Crownwood.DotNetMagic控件库,这个库是在C:\U8SOFT\Portal\DotNetMagic.dll中,自己可以用在VS.Net来编程!!

分析源代码比UAP要简单啊,UAP都包装了。看不懂,还要拿钱买!









------------------------------
那就是Reflector!这是一个.net反编译工具,估计U860以后都是用.net写的吧!学会Reflector的使用后,把用友安装目录U8SOFT里面的Admin.exe文件丢进去,然后在右边树节点Admin.exe右键选择Entry point,就可以看到用友ERP代码开始的地方,大家可以从这里开始看吧,那些源代码很容易看懂的,对你学U8UAP的开发大有帮助!这下面就是U872代码开始的地方,看到 clsLogin是不是觉得很熟悉!
private static void Main(string[] args)
{
try
{
bool flag = false;
if (!WindowsDispatch.HandleRunningInstance(UFIDA.U8.WorkFlow.ProcessResourceManager.ProcessResourceManager.GetString("U8.WF.Designer.Process.frmmain.00115")))
{
if ((args != null) && (args.Length > 0))
{
StringBuilder builder = new StringBuilder();
foreach (string str in args)
{
builder.Append(str);
builder.Append(" ");
}
try
{
SingleLoginInfo info = new SingleLoginInfo().DeSerializable(builder.ToString());
clsLogin login = new clsLogin();
flag = login.login(info.PSubId, info.UserId, info.Pwd, info.AppServer, info.OperDate, info.DataSource, info.WorkStationSerial);
if (flag)
{
LoginInfo.setLoginInfo(login);
Thread.CurrentThread.CurrentCulture = new CultureInfo(info.LanguageID);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
}
}
catch
{
flag = false;
}
}
Application.EnableVisualStyles();
RunApplication(!flag);
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
}

wzqivk 发表于 2023-6-6 10:01:34

ry { SingleLoginInfo info = new SingleLoginInfo().DeSerializable(builder.ToString()); clsLogin login = new clsLogin(); flag = login.login(info.PSubId, info.UserId, info.Pwd, info.AppServer, info.OperDate, info.DataSource, info.WorkStationSerial); if (flag) { LoginInfo.setLoginInfo(login); Thread.CurrentThread.CurrentCulture = new CultureInfo(info.LanguageID); Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; } } catch { flag = false; } } Application.EnableVisualStyles(); RunApplication(!flag); } } catch (Exception exception) { MessageBox.Show(exception.Message); } }

46602907 发表于 2015-10-31 11:27:19

U8API/SaleOrder/SaveU8API/SaleOrder/SaveU8API/SaleOrder/SaveU8API/SaleOrder/SaveU8API/SaleOrder/SaveU8API/SaleOrder/SaveU8API/SaleOrder/Save

syy 发表于 2016-7-25 16:38:02

随便看看随便看看随便看看随便看看随便看看随便看看

1042528230 发表于 2015-10-23 15:52:16

随便看看随便看看随便看看随便看看随便看看随便看看

1042528230 发表于 2015-10-23 15:50:09

随便看看随便看看随便看看随便看看随便看看随便看看

tiange7801 发表于 2013-2-14 06:40:11

这个应该是一个工具软件吧?怎么没有附件呀?

cpmodel 发表于 2013-2-14 08:44:28

tiange7801 发表于 2013-2-14 06:40 static/image/common/back.gif
这个应该是一个工具软件吧?怎么没有附件呀?

网上去搜,这种工具一大把的!!!

lihuaren007 发表于 2013-2-14 11:06:00

怎么没有附件呀?

phoenix546 发表于 2013-2-14 13:00:26

谢谢楼主分享,长见识了。

火焙鱼 发表于 2013-2-14 21:29:31

.net也能反编译啊,呵呵,这就是源代码了!

tiange7801 发表于 2013-2-15 07:57:40


原来是需要自己到网上搜得!

plain 发表于 2013-2-15 09:11:49

谢谢楼主分享

coaben 发表于 2013-3-20 22:20:21

快点啊````迫不及待``

mr.leizhu 发表于 2013-9-6 10:35:40

:L不是很明白干什么用的

fulong36 发表于 2013-10-12 16:59:40

thrthrthdfefefef

sabrina2599 发表于 2013-10-22 15:07:45


发布到我的报表中。。

sabrina2599 发表于 2013-10-22 15:08:49


发布到我的报表中。。

1042528230 发表于 2015-10-23 15:44:30

随便看看随便看看随便看看随便看看随便看看随便看看

1042528230 发表于 2015-10-23 15:45:00

随便看看随便看看随便看看随便看看随便看看随便看看
页: [1] 2
查看完整版本: U8UAP开发最好的辅助工具!