npsnet
Newcomer
I've been pondering for over an hour now about why the following coding will not work. The coding is as logical as it could be, what's the problem?
Imports System.io
Public Class frmID3Tool
Inherits System.Windows.Forms.Form
+ Windows Form Designer generated code
Private Sub tlbToolbar_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
Handles tlbToolbar.ButtonClick
If e.Button Is tlbToolbar.Buttons(0) Then
If dlgOpen.ShowDialog() <> DialogResult.Cancel Then
Dim filepath As String = dlgOpen.FileName
Dim fs As FileStream = New FileStream(filepath,FileMode.Open)
Dim id3title(30) As Byte
fs.Seek(125, SeekOrigin.End)
fs.Read(id3title, 0, 30)
txtTitle.Text = System.Text.Encoding.ASCII.GetString(id3title)
End If
End If
End Sub
End Class
Also, why do I have to declare my variables as bytes and not strings like I'd prefer? Why have to convert it to a string when it could've been a string since it was intialized?
Thanks for your help,
npsnet
Imports System.io
Public Class frmID3Tool
Inherits System.Windows.Forms.Form
+ Windows Form Designer generated code
Private Sub tlbToolbar_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
Handles tlbToolbar.ButtonClick
If e.Button Is tlbToolbar.Buttons(0) Then
If dlgOpen.ShowDialog() <> DialogResult.Cancel Then
Dim filepath As String = dlgOpen.FileName
Dim fs As FileStream = New FileStream(filepath,FileMode.Open)
Dim id3title(30) As Byte
fs.Seek(125, SeekOrigin.End)
fs.Read(id3title, 0, 30)
txtTitle.Text = System.Text.Encoding.ASCII.GetString(id3title)
End If
End If
End Sub
End Class
Also, why do I have to declare my variables as bytes and not strings like I'd prefer? Why have to convert it to a string when it could've been a string since it was intialized?
Thanks for your help,
npsnet