求高手指点VB.NET判断硬盘是否存在文件出错
程序代码:
Private Sub Fm_Login_Load(sender As Object, e As EventArgs) Handles Me.Load If Dir(Application.StartupPath"\login.ini") <> "" Then '判断软件目录是否存在login.ini文件 Dim sb As New System.Text.StringBuilder Dim sr As = New IO.StreamReader(Application.StartupPath"\login.ini") sb.Append(sr.ReadToEnd) Tx_Sever.Text = sb.ToString sr.Close() Else Tx_Sever.Text = "" End If End Sub