如何引用vb.net中项目中包含的文件

时间:2010-04-09 18:04:21

标签: vb.net

哪个目录是在项目中包含它时复制的图像?

1 个答案:

答案 0 :(得分:1)

如果将其复制到输出目录,则可以使用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")