VB.Net获取程序所在的工作目录
'读取程序所在工作目录下debug.txt文件内容,设置DEBUG标志
Dim debug = False
Dim debugFile As String
debugFile = Application.StartupPath & "\debug.txt"
'检查文件是否存在
If My.Computer.FileSystem.FileExist(debugFile) Then
'读取文件全部内容
If My.Computer.FileSystem.ReadAllText(debugFile).StartsWith("1") Then
DEBUG = True
End If
End If