У меня есть приложение Vb, которое сохраняет данные в моем документе У меня есть программа Console_Load, которая создает 2 TXT-файла и проверяет то же, что и другой фрагмент коды ищут те же файлы TXT, но когда я устанавливаю это сообщение, опубликуйте его, он выдает ошибку при загрузке Консоли «Ошибка: преобразование из строки« C/user/mydocument »для ввода boolean недействительно»Ошибка: преобразование из строки «C/user/mydocument» для ввода boolean недействительно
Ниже приведен код : -
Dim chkuser As String
Dim chkpass As String
Dim LoadUser As String
Dim LoadPass As String
Dim userexist As Boolean
Dim passexist As Boolean
Dim fullFilePathu As String
Dim fullFilePathp As String
With My.Computer.FileSystem
fullFilePathu = .CombinePath(.SpecialDirectories.MyDocuments, "user.txt")
fullFilePathp = .CombinePath(.SpecialDirectories.MyDocuments, "user.txt")
If fullFilePathp = False Then
My.Computer.FileSystem.WriteAllText(fullFilePathu, String.Empty, False)
My.Computer.FileSystem.WriteAllText(fullFilePathp, String.Empty, False)
End If
chkpass = .CombinePath(.SpecialDirectories.MyDocuments, "pass.txt")
chkuser = .CombinePath(.SpecialDirectories.MyDocuments, "user.txt")
My.Computer.FileSystem.WriteAllText("chkpass", String.Empty, False)
My.Computer.FileSystem.WriteAllText("chkuser", String.Empty, False)
LoadUser = .ReadAllText(chkuser)
LoadPass = .ReadAllText(chkpass)
userexist = My.Computer.FileSystem.FileExists(chkuser)
passexist = My.Computer.FileSystem.FileExists(chkpass)
If userexist = True Then
UserName.Text = LoadUser
PASSWORD.Text = LoadPass
LOGIN.Enabled = False
AutoON.Enabled = False
statusIO.Text = "Logged In"
LOGIN.Enabled = False
LOGOFF.Enabled = True
PS Я новичок Спасибо заранее
PPS, какая линия? – Plutonix
С My.Computer.FileSystem fullFilePathu = .CombinePath (.SpecialDirectories.MyDocuments, "user.txt") fullFilePathp = .CombinePath (.SpecialDirectories.MyDocuments, "user.txt") Если fullFilePathp = False Тогда My. Computer.FileSystem.WriteAllText (fullFilePathu, String.Empty, False) My.Computer.FileSystem.WriteAllText (fullFilePathp, String.Empty, False) End If chkpass = .CombinePath (.SpecialDirectories.MyDocuments, "pass.txt") chkuser = .CombinePath (.SpecialDirectories.MyDocuments, "user.txt") –
'fullFilePathp = ...' присваивает строку. 'If fullFilePathp = False Then' строка не может быть true или false. Что ты пытаешься сделать? 'С My.Computer.FileSystem' довольно выигрышный – Plutonix