如何使启动c#应用程序

编程入门 行业动态 更新时间:2024-10-28 09:23:22
本文介绍了如何使启动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#应用程序

本文发布于:2023-11-02 13:08:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552489.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!