<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Mind Control Forums - Hundred Miles Software: UltraID3Lib Support</title>
		<link>http://gida.tzo.net/forum//</link>
		<description>UltraID3Lib: A fully object-oriented class library for the reading and editing of both ID3 v1 and ID3 v2.3 tags in MP3 files</description>
		<language>en</language>
		<lastBuildDate>Thu, 09 Sep 2010 10:50:12 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>30</ttl>
		<image>
			<url>http://gida.tzo.net/forum/images/misc/rss.jpg</url>
			<title>Mind Control Forums - Hundred Miles Software: UltraID3Lib Support</title>
			<link>http://gida.tzo.net/forum//</link>
		</image>
		<item>
			<title>Object reference not set to an instance of an object.</title>
			<link>http://gida.tzo.net/forum//showthread.php?t=32673&amp;goto=newpost</link>
			<pubDate>Sun, 22 Aug 2010 17:46:23 GMT</pubDate>
			<description><![CDATA[I have been getting this error on certain MP3 Files, not sure why, any help? 
 
The exception occurs on Line 60 "u.Read(p);" 
 
 
Code: 
---------...]]></description>
			<content:encoded><![CDATA[<div>I have been getting this error on certain MP3 Files, not sure why, any help?<br />
<br />
The exception occurs on Line 60 "u.Read(p);"<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.IO;<br />
using System.Diagnostics;<br />
using System.Data.SqlClient;<br />
using HundredMilesSoftware.UltraID3Lib;<br />
<br />
namespace MusicLibrary<br />
{<br />
&nbsp; &nbsp; public partial class Form1 : Form<br />
&nbsp; &nbsp; {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; DataTable dtArtists = new DataTable("Artists");<br />
&nbsp; &nbsp; &nbsp; &nbsp; DataTable dtAlbums = new DataTable("Albums");<br />
&nbsp; &nbsp; &nbsp; &nbsp; DataTable dtTracks = new DataTable("Tracks");<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; public Form1()<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitializeComponent();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtArtists.Columns.Add("ArtistName");<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtAlbums.Columns.Add("AlbumTitle");<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtTracks.Columns.Add("TrackTitle");<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtArtists.PrimaryKey = new DataColumn[] { dtArtists.Columns["ArtistName"] };<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtAlbums.PrimaryKey = new DataColumn[] { dtAlbums.Columns["AlbumTitle"] };<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtTracks.PrimaryKey = new DataColumn[] { dtTracks.Columns["TrackTitle"] };<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tssl.Text = String.Format("{0} {1}", DateTime.Now.Date, DateTime.Now.TimeOfDay);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; private void btnBrowse_Click(object sender, EventArgs e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (fbd.ShowDialog() == DialogResult.OK)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbxBrowse.Text = fbd.SelectedPath.ToString();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnStart.Enabled = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnStop.Enabled = true;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; private void btnStart_Click(object sender, EventArgs e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnExport.Enabled = true;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<string> files = GetFilesRecursive(fbd.SelectedPath.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tspb1.Maximum = files.Count;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UltraID3 u = new UltraID3();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (string p in files)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u.Read(p);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dtArtists.Rows.Contains(u.Artist.ToString()))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtArtists.Rows.Add(u.Artist.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbxArtist.Text += String.Format("{0}\r\n",u.Artist.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tspb1.Value += 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!dtAlbums.Rows.Contains(u.Album.ToString()))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtAlbums.Rows.Add(u.Album.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbxAlbum.Text += String.Format("{0}\r\n",u.Album.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tspb1.Value += 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!dtTracks.Rows.Contains(u.Title.ToString()))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dtTracks.Rows.Add(u.Title.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbxTrack.Text += String.Format("{0}\r\n",u.Title.ToString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tspb1.Value += 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application.DoEvents();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; private void btnExport_Click(object sender, EventArgs e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; public static List<string> GetFilesRecursive(string initialDirectroy)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<string> result = new List<string>();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stack<string> stack = new Stack<string>();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stack.Push(initialDirectroy);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (stack.Count > 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string dir = stack.Pop();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result.AddRange(Directory.GetFiles(dir, "*.mp3"));<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (string dn in Directory.GetDirectories(dir))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stack.Push(dn);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox.Show("Error: Could not open the directory!");<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return result;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; private void btnStop_Click(object sender, EventArgs e)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application.Exit();<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; }<br />
}</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://gida.tzo.net/forum//forumdisplay.php?f=38">Hundred Miles Software: UltraID3Lib Support</category>
			<dc:creator>CptCrunch</dc:creator>
			<guid isPermaLink="true">http://gida.tzo.net/forum//showthread.php?t=32673</guid>
		</item>
	</channel>
</rss>
