主题:VB.NET如何获取安装目录或者程序的相对路径
请问VB.NET如何获取安装目录或者程序的相对路径
Dim a1 As Image
Dim a2 As String
Try
a2 = Application.StartupPath
a1 = Image.FromFile("logook1.gif") '原来是"D:\WindowsApplication1\logook1.gif"
Label1.Image = a1
Catch ex As Exception
MessageBox.Show("程序意外错误!", "提示", MessageBoxButtons.OK)
Me.Close()
End Try
我想别人不一定会装在D盘,path怎么获取呢?相对路径又是错的,大侠帮帮忙
Dim a1 As Image
Dim a2 As String
Try
a2 = Application.StartupPath
a1 = Image.FromFile("logook1.gif") '原来是"D:\WindowsApplication1\logook1.gif"
Label1.Image = a1
Catch ex As Exception
MessageBox.Show("程序意外错误!", "提示", MessageBoxButtons.OK)
Me.Close()
End Try
我想别人不一定会装在D盘,path怎么获取呢?相对路径又是错的,大侠帮帮忙