如何从c#.net windows应用程序调用vb6.0 exe文件 [英] How to call an vb6.0 exe file from c#.net windows applicaion
问题描述
我有一个vb6.0应用程序,需要从c#调用它。 Process.start可以正常工作,但每次调用都很慢。是否可以在第一次加载c#应用程序时加载vb6.0 exe,并在必要时执行以避免延迟。
实际上应用程序之间的数据通信不是问题。只需要从c#应用程序调用vb6 exe(GUI)文件。甚至一个简单的vb6表单(exe),从Visual Studio(c#win应用程序)调用时至少需要4秒才能使用proccess.start加载表单()
< b>我尝试了什么:
MyvbApplication.StartInfo.FileName =MEDICURE.exe;
MyVbapplicatkion.StartInfo .Arguments =PatientRegistration;
MyVbApplication.StartInfo.CreateNoWindow = true;
MyVbApplication.Start();
I have an vb6.0 application and need to call it from c#. Process.start works fine for this but is very slow for each call. Is it possible to load vb6.0 exe when c# application is loaded at first time and execute when necessary in order to avoid that delay.
Actually data communications between application is not the issue. Just need to call a vb6 exe (GUI) file from c# application. Even a simple vb6 form (exe), when calling from Visual studio (c# win application) takes minimum 4 seconds to load the form using proccess.start()
What I have tried:
MyvbApplication.StartInfo.FileName = "MEDICURE.exe";
MyVbapplicatkion.StartInfo.Arguments = "PatientRegistration";
MyVbApplication.StartInfo.CreateNoWindow = true;
MyVbApplication.Start();
推荐答案
不,因为您需要将参数传递给应用程序,并且只有当应用程序感觉它时才会读取它们 - 通常是在它启动时。
我建议最简单的解决方案是更改VB6应用程序以支持进程间通信进程间通信 - Windows应用程序| Microsoft Docs [ ^ ]看看你是否可以在它们之间运行一个套接字或类似的东西。
No, because you need to pass arguments to the app, and they are only read when the app feels like it - normally when it powers up.
I'd suggest that the simplest solution would be to change the VB6 app to support interprocess communications Interprocess Communications - Windows applications | Microsoft Docs[^] and see if you can get a socket or similar running between them.
这篇关于如何从c#.net windows应用程序调用vb6.0 exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!