The path is not of a legal form.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
the code:

<div style="color:Black;background-color:White; <pre>
OpenFileDialog1.Filter = <span style="color:#A31515; "Text files (*.txt)|*.txt"
OpenFileDialog1.DefaultExt = <span style="color:#A31515; "txt"
OpenFileDialog1.Title = <span style="color:#A31515; "Select File"
OpenFileDialog1.ShowDialog()
OpenFileDialog1.OpenFile()

<span style="color:Blue; Dim strContents <span style="color:Blue; As <span style="color:Blue; String = <span style="color:Blue; My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
<span style="color:Blue; Dim crlf() <span style="color:Blue; As <span style="color:Blue; String = {vbCrLf}
<span style="color:Blue; Dim line <span style="color:Blue; As <span style="color:Blue; String() = strContents.Split(crlf, StringSplitOptions.None)


<span style="color:Blue; For i = 0 <span style="color:Blue; To 4
<span style="color:Blue; Me.Controls(<span style="color:#A31515; "TextBox" & i + 1).Text = line(i)

<span style="color:Blue; Next
PictureBox1.Image = Image.FromFile(line(6))
[/code]

The error:

<div style="color:Black;background-color:White; <pre>
PictureBox1.Image = Image.FromFile(line(6))
[/code]
<hr class="sig Kevin

View the full article
 
Back
Top