如何使启动c#应用程序 [英] how to make boot able c# application

查看:67
本文介绍了如何使启动c#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的应用程序像Windows资源管理器,我想让它可启动所以我可以在启动时从USB运行它

喜欢os安装盘

有什么办法我可以做到这一点

请帮我解决这个问题

解决方案

不,你不能。

C#在很大程度上依赖于Windows和.NET运行时。您编译的C#应用​​程序包含.NET字节码,然后由.NET JIT将其转换为本机x86指令。

但是你可以编写一个AOT编译器,它可以将你编译的.NET字节码转换为x86指令,但是你必须自己实现一切,包括WinForms,就像重写整个WinAPI一样。

我认为除了一般理解之外你没有任何实际问题。像Windows资源管理器这样的应用程序与操作系术语引导适用于OS(和其他一些东西)而不适用于应用程序。看起来你混淆了启动,加载,安装等等。



如果你真的开发了一些应用程序,它不需要任何特殊的东西在USB闪存驱动器或其他可移动媒体上执行。你甚至不需要安装。你只需要放入这个媒体并启动它。如果没有发生,你不能认为你真的创建了一个应用程序,应该更多地工作。



当然你需要安装并运行操作系统。 NET安装。没有.NET的Windows已经过时了,所以这不是一个大问题。但是,如果您希望在没有安装.NET的情况下工作,那么您几乎无法轻松完成。创建一个非托管(本机)Windows应用程序可能会更容易。



-SA


使用C#或VB开发自己的操作系统.NET [ ^ ]可能会对您有所帮助。


i wrote application like windows explorer and i want to make it bootable so i can run it from usb at boot
like os installation disk
is there any way i can do that
please help me with this thanks

解决方案

No, you can't.
C# relies heavily on both Windows and the .NET runtime. Your compiled C# application contains the .NET bytecode which is then translated to native x86 instructions by the .NET JIT.
You could however write an AOT compiler which would convert your compiled .NET bytecode to x86 instructions, however you'd have to implement everything yourself including WinForms, which is like rewriting the entire WinAPI.


I think you have no real problems except general understanding. An "application like Windows Explorer" is nothing like OS. The term "booting" is applicable to OS (and some other things) and not to the applications. It looks like you confuse "booting", "loading", "installation" and perhaps more.

If you really develop some application, it does not need anything special to be executed on a USB flash drive or other removable media. You don't even need installation. You just put in on this media and start it. If it does not happen, you cannot consider that you really created an application, should work on it more.

And of course you need installed and running OS, with .NET installed. Windows without .NET are going obsolete, so this is not a big concern. However, if you expect to work without installed .NET, you hardly can do it in any easy way. It would probably be easier to create an unmanaged (native) Windows application.

—SA


Develop Your Own Operating System in C# or VB.NET[^] might help you.


这篇关于如何使启动c#应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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