【发布时间】:2014-04-16 15:36:49
【问题描述】:
在我的程序中,我有一个注册页面,用户可以在其中输入所有详细信息以注册到系统。 On this page I have a button that when selected should open up a windows form that is located on another project, however when I select this button nothing is happening.
windows窗体应用程序背后的代码:
public GenerateToken()
{
InitializeComponent();
}
public void Main()
{
Application.Run(GenerateToken.ActiveForm);
}
上面的代码单独在一个项目中找到。在另一个项目中,这是调用此窗体的控制器的代码:
public ActionResult generateToken()
{
new TokenGenerator.GenerateToken().Main();
return RedirectToAction("RegisterPage");
}
该按钮所在的视图中的代码是:
<input id="GenToken" type="button" value="generateToken" onclick = "generateToken" />
我在按钮方面做错了什么,或者我试图将它们链接在一起的方式有误吗?
【问题讨论】:
-
WindowsForms 和 Web Application 是完全不同的概念。你不能用这种方法做你想做的事。您能详细说明您需要做什么吗?
-
在我的 mvc 项目中,我有一个 wcf 应用程序,其中有用于注册过程的视图和控制器。 In view for the registration I must place a button that when selected should pop up a windows form application that would allow the user to enter a password and pin that will then use an encryption method to generate a key code.加密过程有效,但是我似乎无法在单击按钮时打开 Windows 窗体应用程序。
-
每个客户的机器上都有这个 win 应用程序吗?这将作为本地机制还是在网络上工作?可以做到,但似乎这种方式不是做这些事情的正确方式。
-
是的,每个客户端都有它,它将作为本地机制工作。我知道这不是正确的方法,但是必须以这种方式完成任务。
标签: c# jquery winforms asp.net-mvc-3