|
-
Mar 14th, 2008, 07:14 AM
#1
Thread Starter
Addicted Member
-
Mar 14th, 2008, 07:20 AM
#2
Re: Illegal characters in path.
1. Check if [My.Settings.masuratori_preluare_date] returns a valid file path.
2. Open that file and look thru each line to see it's a valid file path.
-
Mar 14th, 2008, 07:30 AM
#3
Thread Starter
Addicted Member
-
Mar 14th, 2008, 07:31 AM
#4
Re: Illegal characters in path.
The lines in that file are not filenames/paths to files, so why are you calling IO.Path.GetFileNameWithoutExtension() on them? Thats whats causing the error.
-
Mar 14th, 2008, 07:36 AM
#5
Re: Illegal characters in path.
OK... so the lines in your file are not file paths at all... You have to read them as is and add to your listbox
Code:
Dim reader As New StreamReader(My.Settings.masuratori_preluare_date)
Do While reader.Peek <> -1
Me.ListBox1.Items.Add(reader.ReadLine)
Loop
reader.Close()
Or even shorter this way
Code:
Dim lines() As String = IO.File.ReadAllLines(My.Settings.masuratori_preluare_date)
Me.ListBox1.Items.AddRange(lines)
-
Mar 14th, 2008, 07:38 AM
#6
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|