InterviewSolution
| 1. |
Solve : VB path problem... File not found? |
|
Answer» I made sure the file exists and I'm still getting problems. I made sure the file exists and I'm still getting problems. How did you check? Code: [Select]If My.Computer.FileSystem.FileExists("c://Check.txt") MsgBox("File found.") Else MsgBox("File not found.") End If By the way, if your file is delimited, you were on the right track with Using MyReader: This is the entire snippet from the MSDN help: Code: [Select]Using MyReader As New _ Microsoft.VisualBasic.FileIO.TextFieldParser("C:\Documents and Settings\Nick\Desktop\readertest.txt") MyReader.TextFieldType = FileIO.FieldType.Delimited MyReader.SetDelimiters(",") Dim currentRow As String() While Not MyReader.EndOfData Try currentRow = MyReader.ReadFields() Dim currentField As String For Each currentField In currentRow MsgBox(currentField) Next Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException MsgBox("Line " & ex.Message & _ "is not valid and will be skipped.") End Try End While End Using Good LUCK. Sorry Gamerx365, LOOKS like I sent you down the wrong path. I never said I was a .NET programmer.Quote from: Sidewinder on September 26, 2008, 02:31:42 PM Quotei made sure it was there, and also I checked the path from the PROPERTIES. I've tried the file in different places also.QuoteI made sure the file exists and I'm still getting problems.How did you check? i made sure it was there, and also I checked the path from the properties Please explain. Have you checked the file existence with program code? Is Nick your userid? You may not have permissions for the file. Only other thing I can think of is the hidden attribute of the file is flipped on. well i CREATED the file right before trying this. Yes i'm using nick as my userid. I went to the source and it was visible is what i mean when i said i made sure it was there. I probably dont have admissions. my step dad is retarded and changed the password on my admin account. |
|