取得智能设备程序主目录(Compact Framework)
在Embedded Visual Basic中,程序执行的当前目录可以通过App.Path属性获得。可是.Net CF不再支持了。(遗憾,不过更令人遗憾的是form.scale也不被支持了)
.Net CF中只能靠Assembly获得。
Code:
.Net CF中只能靠Assembly获得。
Code:
Public Function GetPath() As String
Dim fullAppName As String = [Assembly].GetExecutingAssembly().GetName().CodeBase
Dim fullAppPath As String = Path.GetDirectoryName(fullAppName)
GetPath = fullAppPath
End Function
Dim fullAppName As String = [Assembly].GetExecutingAssembly().GetName().CodeBase
Dim fullAppPath As String = Path.GetDirectoryName(fullAppName)
GetPath = fullAppPath
End Function