所以我基本上是在编写程序,它需要从资源中提取文件,我正在使用
WriteFileToPath(ConsoleApplication2.Properties.Resources.raw, Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\" + FileName + ".exe");
但是实际上得到了错误: Error 1 The type or namespace name 'Properties' does not exist in the namespace 'ConsoleApplication2' (are you missing an assembly reference?) c:\users\sand n\documents\visual studio 2013\Projects\ConsoleApplication2\ConsoleApplication2\Program.cs 31
我可以使用什么参考来解决此问题,我知道可以做到这一点,因为我的朋友实际上在做同样的事情。
问题:您正在添加resource
(在您的案例exe
文件中)作为常规的project file
使用Add Existing file
选项。
解决方案:您应该在项目窗口中使用添加Resource
(在您的案例exe
文件中)。Resources tab
properties
试试这个:
1.右键单击project
并转到Properties
。
2.转到Resources
选项卡。
3.Add Resource
单击顶部的下拉菜单。
4.选择Add Exisiting FIle...
。
5.选择exe file
要添加的。
现在从程序尝试访问如下:
<ApplicationName>.Properties.Resources.<FileName>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句