将文件嵌入到已编译的 .exe 中

发布于 2024-12-27 13:21:53 字数 222 浏览 2 评论 0原文

我正在开发一个项目,该项目是关于制作带有内置库的视频播放器。

我想要做的是在 Flash CS5、Python(使用 Phonon)或 C# 中创建一个自定义视频播放器,它可以播放任何视频文件(与扩展名无关)。这个想法是,当我运行我的程序时,将播放嵌入在编译的 .exe 中的视频文件。

有没有办法可以将视频文件包含在编译后的 .exe 中?

编辑:视频文件大小约为 100 MB。

I am working on a project that is about making a video player with built in libraries.

What I want to do is create a custom video player in Flash CS5, Python (Using Phonon) or C# which can play any video file (independent of the extension). The idea is that when I run my program, the video files that are embedded in the complied .exe will be played.

Is there a way I can include the video file with the compiled .exe?

EDIT: the video files will be around 100 MB in size.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨巷深深 2025-01-03 13:21:53

让我看看我是否正确理解了你的问题。我假设您想要将视频文件嵌入到您正在创建的视频播放器应用程序中。视频可以是任何类型(.avi、.mp4、.flv),并且应用程序将是可执行文件(.exe)。

如果是这种情况,那么您需要做的是,使用 Visual Studio 将视频文件添加为项目中的资源,重建项目并从代码访问资源。

例如,如果您已将 MyVideo.avi 添加到项目中,则在构建项目后,您可以将其作为 MyNamespace.MyVideo.avi 进行访问。

以下是一些 SO 帖子,提供了项目中嵌入式资源的更具体示例:

Let me see if I understood your question correctly. I am assuming you want to embed a video file into a video player application that you are creating. The video can be on any type (.avi, .mp4, .flv) and the application will be an executable (.exe).

If this is the case then what you need to do is, using Visual Studio, add your video file as a resource in your project, rebuild the project and access the resource from your code.

For example, if you have added MyVideo.avi to your project, after building the project you can access it as MyNamespace.MyVideo.avi.

Here are a couple of SO posts that provide more concrete examples of embedded resources within a project:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文