ITeye博客

VB.Net获取程序所在的工作目录

kiki1120 · 2012-08-23 16:34 · .Net · 编程语言 · Markdown

'读取程序所在工作目录下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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。