如何将.jpg包含到dll中?

编程入门 行业动态 更新时间:2024-10-11 02:27:27
本文介绍了如何将.jpg包含到dll中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个第三方应用程序,可以通过.cs代码创建一个dll文件。

I have a third-party application that creates a dll file out my .cs code.

在我的.cs代码中,我引用了一个文件。

In my .cs code I reference a file.

我如何编译dll或.cs使其包含.jpg文件以及代码?

How do I compile the dll or .cs to include the .jpg file along with the code?

我为第三方应用程序提供的选项不允许我导出.jpg

The options I have for the third-party application does not allow me to export the .jpg

导入过程仅查看.cs和关联的.dll。

The import process only looks at the .cs and the associated .dll.

一旦第三方应用程序在导出过程中使用可视化的stuido或其他东西创建了dll,是否可以将文件添加到dll中?

Is there a way to add the file to the dll once the third-party application has created the dll in the export process with visual stuido or something?

推荐答案

是的,这是可能的。如果文件被dll中的代码使用,则需要通过属性>>构建操作>>嵌入资源设置将文件嵌入文件中。

Yes this is possible. If the file is used by your code in the dll then the file needs to be embedded thorugh the Properties >> Build Action >> Embedded Resource setting:

您必须编辑.csproj并将代表您文件的节点更改为:

You have to edit the .csproj and change the node that represents your file to:

<EmbeddedResource Include="Resources\yourEmbeddedResource.json" />

来源:

Source:

  • starbeamrainbowlabs/blog /article.php?article=posts/180-Embedding-Resources.html ;
  • www.codeproject/Articles/114997/Embedding-and-Using-Resources-from-Net-Assembly ;
  • 如何在Visual Studio Code中将文件标记为嵌入式资源?;
  • starbeamrainbowlabs/blog/article.php?article=posts/180-Embedding-Resources.html;
  • www.codeproject/Articles/114997/Embedding-and-Using-Resources-from-Net-Assembly;
  • How to mark a file as an embedded resource in Visual Studio Code?;
  • 更多推荐

    如何将.jpg包含到dll中?

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

    发布评论

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

    >www.elefans.com

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