我需要帮助来解决这个问题吗? [英] I need help to solve this problem?

查看:83
本文介绍了我需要帮助来解决这个问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


帮我解决这个问题:

在处理项目(win应用程序)时,我需要从项目中删除资源(图片).

但是,当我运行项目时-它会显示错误消息.

错误消息:
属性"Items"的代码生成失败.错误为:找不到文件" C:\ Users \ Administrator \ Desktop \ org \ org \ org \ Resources \ black-bugatti-veyron.jpg".



可能您输入了错误的路径.尝试通过提供如下所示的根路径.

 字符串 ImagePath =  @" 〜\ Resources \ black-bugatti-veyron.jpg";
如果(File.Exists(ImagePath))
{
  // 在此处删除文件
} 



希望它能起作用.


Hi
Help me solve this problem:

When working on my project (win application), I need to remove a resource(picture) from the project.

But, When I run the project - it gives an error message.

Error Message:
Code generation for property ''Items'' failed. Error was: ''Could not find file ''C:\Users\Administrator\Desktop\org\org\org\Resources\black-bugatti-veyron.jpg''.''

解决方案

Hi,

probably you may have given the wrong path. try by giving the root path like below.

string ImagePath = @"~\Resources\black-bugatti-veyron.jpg";
if(File.Exists(ImagePath))
{
  //Delete the file here
}



hope it works.


这篇关于我需要帮助来解决这个问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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