如何在 vb.net 中引用项目中包含的文件 [英] how to reference a file that was included in the project in vb.net

查看:33
本文介绍了如何在 vb.net 中引用项目中包含的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您将图像包含在项目中时,图像会复制到哪个目录中?

in which directory is an image copied when you include it in your project?

推荐答案

如果是复制到输出目录下,可以使用Path.Combine:

If it's copied to the output directory, you can use Path.Combine:

Shared ReadOnly AppDirectory As String = Path.GetDirectoryName(New Uri(GetType(Program).Assembly.CodeBase).LocalPath)

Dim filePath As String = Path.Combine(AppDirectory, "MyFile.jpg")

这篇关于如何在 vb.net 中引用项目中包含的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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