Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
GeneralRe: why I cann't cast the object???? Pin
fftongzhi27-Sep-02 16:02
fftongzhi27-Sep-02 16:02 
GeneralRe: why I cann't cast the object???? Pin
leppie27-Sep-02 16:21
leppie27-Sep-02 16:21 
GeneralRe: why I cann't cast the object???? Pin
fftongzhi27-Sep-02 16:36
fftongzhi27-Sep-02 16:36 
AnswerRe: why I cann't cast the object???? Pin
Eric Gunnerson (msft)27-Sep-02 8:43
Eric Gunnerson (msft)27-Sep-02 8:43 
GeneralRe: why I cann't cast the object???? Pin
fftongzhi27-Sep-02 16:21
fftongzhi27-Sep-02 16:21 
GeneralRe: why I cann't cast the object???? Pin
fftongzhi27-Sep-02 20:30
fftongzhi27-Sep-02 20:30 
GeneralADO.NET with C# Pin
Rickard Andersson2027-Sep-02 0:20
Rickard Andersson2027-Sep-02 0:20 
GeneralRe: ADO.NET with C# Pin
leppie27-Sep-02 2:38
leppie27-Sep-02 2:38 
GeneralRe: ADO.NET with C# Pin
Rickard Andersson2027-Sep-02 3:55
Rickard Andersson2027-Sep-02 3:55 
GeneralRe: ADO.NET with C# Pin
David Stone27-Sep-02 8:42
sitebuilderDavid Stone27-Sep-02 8:42 
GeneralRe: ADO.NET with C# Pin
Derek Smigelski28-Sep-02 10:06
Derek Smigelski28-Sep-02 10:06 
GeneralRe: ADO.NET with C# Pin
David Stone28-Sep-02 10:32
sitebuilderDavid Stone28-Sep-02 10:32 
Questionmay i read the same object on network from a file? Pin
imran_rafique26-Sep-02 16:27
imran_rafique26-Sep-02 16:27 
AnswerRe: may i read the same object on network from a file? Pin
Rickard Andersson2026-Sep-02 20:41
Rickard Andersson2026-Sep-02 20:41 
Questionhow to show gif image on toolbar? Pin
bclangren26-Sep-02 15:02
bclangren26-Sep-02 15:02 
AnswerRe: how to show gif image on toolbar? Pin
Luis Alonso Ramos27-Sep-02 4:36
Luis Alonso Ramos27-Sep-02 4:36 
Generalctl+c problem Pin
Anonymous26-Sep-02 9:53
Anonymous26-Sep-02 9:53 
GeneralAccessing data in one assembly from another Pin
ez226-Sep-02 9:30
ez226-Sep-02 9:30 
GeneralRe: Accessing data in one assembly from another Pin
leppie26-Sep-02 10:41
leppie26-Sep-02 10:41 
GeneralCopy of files from one folder to another Pin
Cintch26-Sep-02 6:05
Cintch26-Sep-02 6:05 
GeneralRe: Copy of files from one folder to another Pin
leppie26-Sep-02 10:53
leppie26-Sep-02 10:53 
General[Remoting]No receiver registered Pin
Ricciolo26-Sep-02 5:50
Ricciolo26-Sep-02 5:50 
Generalnull characters when outputing string to file Pin
Humpo26-Sep-02 5:18
Humpo26-Sep-02 5:18 
GeneralRe: null characters when outputing string to file Pin
Stephane Rodriguez.26-Sep-02 5:42
Stephane Rodriguez.26-Sep-02 5:42 
GeneralRe: null characters when outputing string to file Pin
leppie26-Sep-02 11:00
leppie26-Sep-02 11:00 
Hi, I find its easier to just read the last 128bytes from a mp3, then as I did this recently, here's my complete ID3 class Smile | :) Cheers

public class ID3v1Tag //really 1.1 :)
{
	string TAG; //last 3 bytes
	string songtitle; // 30 characters 
	string artist; // 30 characters 
	string album; //30 characters 
	string year; //4 characters 
	string comment; //28 characters
	byte track; // 1 byte, 0 byte b4 that
	byte genre;// 1 byte

	public ID3v1Tag(byte[] block)
	{
		if (block.Length != 128) throw new Exception("Black must be 128 bytes in size");
		TAG = Encoding.Default.GetString(block, 0, 3);
		if (TAG != "TAG") throw new Exception("Not an ID3 v1 tag");
		songtitle = Encoding.Default.GetString(block, 3, 30);
		artist = Encoding.Default.GetString(block, 33, 30);
		album = Encoding.Default.GetString(block, 63, 30);
		year = Encoding.Default.GetString(block, 93, 4);
		comment = Encoding.Default.GetString(block, 97, 28);
		track = block[126];
		genre = block[127];
	}

	public string SongTitle {get {return songtitle;}}
	public string Artist {get {return artist;}}
	public string Album {get {return album;}}
	public string Year {get {return year;}}
	public string Comment {get {return comment;}}
	public int Track {get {return track;}}
	public string Genre {get {return ((GenreType)genre).ToString();}}

	private enum GenreType :byte
	{
		Blues = 0,
		ClassicRock,
		Country,
		Dance,
		Disco,
		Funk,
		Grunge,
		HipHop,
		Jazz,
		Metal,
		NewAge,
		Oldies,
		Other,
		Pop,
		RnB,
		Rap,
		Reggae,
		Rock,
		Techno,
		Industrial,
		Alternative,
		Ska,
		DeathMetal,
		Pranks,
		Soundtrack,
		EuroTechno,
		Ambient,
		TripHop,
		Vocal,
		JazzFunk,
		Fusion,
		Trance,
		Classical,
		Instrumental,
		Acid,
		House,
		Game,
		SoundClip,
		Gospel,
		Noise,
		AlternRock,
		Bass,
		Soul,
		Punk,
		Space,
		Meditative,
		InstrumentalPop,
		InstrumentalRock,
		Ethnic,
		Gothic,
		Darkwave,
		TechnoIndustrial,
		Electronic,
		PopFolk,
		Eurodance,
		Dream,
		SouthernRock,
		Cult,
		Gangsta,
		Top40,
		ChristianRap,
		PopFunk,
		Jungle,
		NativeAmerican,
		Cabaret,
		NewWave,
		Psychadelic,
		Rave,
		Showtunes,
		Trailer,
		LoFi,
		Tribal,
		AcidPunk,
		AcidJazz,
		Polka,
		Retro,
		Musical,
		RocknRoll,
		HardRock,
		None = 255,
	}

}


Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.