[英]Simple Windows form app and .NET framework requirements in XP
I have written a very simple Windows form application (my first) in C# using Visual Studio. 我已经使用Visual Studio用C#编写了一个非常简单的Windows窗体应用程序(我的第一个)。 The application simply shows a dialog with information about the local machine (Local IPs, user name, PC name, domain, among others) and that's it.
该应用程序仅显示一个对话框,其中包含有关本地计算机的信息(本地IP,用户名,PC名称,域等),仅此而已。 It finishes when the users clicks the 'OK' button.
当用户单击“确定”按钮时,它完成。
I'd like to deploy the application as an executable that runs directly on double click. 我想将应用程序部署为可直接双击运行的可执行文件。 I have extracted the executable generated by Visual Studio in the project folder and I've succesfully run it in a number of different computers.
我已经在项目文件夹中提取了Visual Studio生成的可执行文件,并且已经在许多不同的计算机上成功运行了该可执行文件。 However, on some computers with XP I get an error message saying that it is not a valid WIN32 application.
但是,在装有XP的某些计算机上,我收到一条错误消息,指出它不是有效的WIN32应用程序。
I'm pressuming the problem is the .NET framework not being present or an older version than the targeted version is installed. 我要强调的问题是.NET框架不存在或安装了比目标版本更旧的版本。
My question is, is it possible to ensure that the application runs on (at least) Windows XP but still have it as a simple executable that runs on double click? 我的问题是,是否可以确保该应用程序至少在Windows XP上运行,但仍可以作为双击运行的简单可执行文件?
Thanks in advance. 提前致谢。
You could try one of the following approaches: 您可以尝试以下方法之一:
EDIT1: .NET Native requires Windows 10, crossed it out from above 编辑1: .NET Native需要Windows 10,从上方划掉了它
EDIT2: Added C++ with WMI as an alternative approach EDIT2:使用WMI添加了C ++作为替代方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.