将exe嵌入到其他c#项目中 [英] embedding an exe into other c# project

查看:85
本文介绍了将exe嵌入到其他c#项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想通过一个例子告诉我的问题:



没有代码我只有exe(例如:一个exe包含所有产品信息当我点击button1(在其他项目中)时,我想看到这些信息。并且我可以在不编写代码的情况下执行此操作。我的意思是只想将exe嵌入到其他项目中,当按下button1时我想查看数据。这可能吗?



相同但其他例子:



我有程序,我想用计算器有人做了一个计算器程序,我得到了它的exe,没有源代码。此时我可能不想编写自己的计算器程序。所以我将我发现的这个calculator.exe添加到我的程序中。

在我的程序中有button1,当我点击button1时我想要显示计算器。

也许你们可以提供更好的方法吗?



谢谢

解决方案

将方法附加到按钮的Click事件:

  private   void  Button1_Click( object  sender,EventArgs e)
{
Form1 newForm1Instance = new Form1();
newForm1Instance.Show();
this .Close();
}





这应创建一个Form1类的新实例,显示它并关闭包含该按钮的表单。 / blockquote>

如果你没有这个程序的源代码,那么你可以做的很少。如果您有,那么您需要修改它以执行以下操作。 Program1( login.exe )需要独立运行,按下按钮应该调用 System.Diagnostics.Process.Start() [ ^ ],加载您想要加载的程序,以及然后终止。 login.exe 程序需要使用一些参数或配置文件来获取它希望运行的应用程序的名称。


我在c#windows窗体上有两个不同的项目我想在c#表单中合并到单一平台我该怎么办?请快速告诉我


Hello to everybody I want to tell my problem with an examples :

There is no code I have just exe(For example: an exe includes all Products informations) and I want to see that informations when I click button1 (which is in other project).And Can I do this without writing codes .I mean just want to embed the exe into other project and when press button1 I want to see data.İs this possible ?

Same but other example :

I have program and I want to use calculator and someone made a calculator program and I got it's exe and there is no source code. At this point I may not want to write my own calculator program.So I add this calculator.exe that I found into my program.
And in my program there is button1 and when I clicked the button1 I want to show calculator.
Maybe you guys can offer better way to do?

thanks

解决方案

Attach a method to the button's Click event:

private void Button1_Click( object sender, EventArgs e)
{
    Form1 newForm1Instance = new Form1();
    newForm1Instance.Show();
    this.Close();
}



That should create a new instance of class Form1, show it and close the form that contained the button.


If you do not have the source code for this program then there is very little you can do. If you do have it then you need to modify it to do the following. Program1 (login.exe) will need to run independently and on press of a button should call System.Diagnostics.Process.Start()[^], to load whatever program you want loaded, and then terminate. The login.exe program will need to use some parameter or config file to get the name of the application that it wishes to run.


i have 2 diffrent project on c# windows form i want to merge in single platform in c# form how can i do thos? please tell me fast


这篇关于将exe嵌入到其他c#项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆