Click here to Skip to main content
15,911,142 members
Home / Discussions / C#
   

C#

 
GeneralEditing a winforms DataGrid Pin
bartwinsimpson23-Oct-04 22:01
bartwinsimpson23-Oct-04 22:01 
GeneralRe: Editing a winforms DataGrid Pin
Ghazi H. Wadi24-Oct-04 0:49
Ghazi H. Wadi24-Oct-04 0:49 
GeneralRe: Editing a winforms DataGrid Pin
DougW4824-Oct-04 5:36
DougW4824-Oct-04 5:36 
GeneralC# remoting for interprocess communication Pin
ting66823-Oct-04 17:54
ting66823-Oct-04 17:54 
GeneralRe: C# remoting for interprocess communication Pin
Alex Korchemniy24-Oct-04 9:31
Alex Korchemniy24-Oct-04 9:31 
GeneralRe: C# remoting for interprocess communication Pin
ting66824-Oct-04 15:50
ting66824-Oct-04 15:50 
QuestionEdit MP3 ID3 Tags in C#? Pin
ethanwa23-Oct-04 17:22
ethanwa23-Oct-04 17:22 
AnswerRe: Edit MP3 ID3 Tags in C#? Pin
Nick Parker24-Oct-04 4:06
protectorNick Parker24-Oct-04 4:06 
I will get you started and then let you finish up, this is really not a difficult task. If you read ID3 made easy[^], they explain the byte layout for the ID3 tag within a file. If you have further questions please feel free to post here. The following should get the ID3 tag out of your file:

class ID3Tag
{
    public string title;
    public string artist;
    public string album;
    public string year;
    public string comment;
    public string tracknumber;
    public string genre;
}


private ID3Tag GetTag(string file)
{
    string strTag = string.Empty;
    ID3Tag tag = new ID3Tag();
    ASCIIEncoding encoding = new ASCIIEncoding();
    FileStream fs = new FileStream(file, FileMode.Open);
    if(fs != null)
    {
        byte[] block = new byte[128];
        fs.Seek(-128, SeekOrigin.End);
        fs.Read(block, 0, 128);
        fs.Close();

        strTag = encoding.GetString(block);
        if(strTag.Substring(0,3) == "TAG")
        {
            tag.title = strTag.Substring(3, 30);
            tag.artist = strTag.Substring(33, 30);
            tag.album = strTag.Substring(63, 30);
            tag.year = strTag.Substring(93, 4);
            tag.comment = strTag.Substring(97, 28);
            if(strTag[125] == 0)
            {
                tag.tracknumber = strTag[126];
            }
            else
            {
                tag.tracknumber = 0;
            }
            tag.genre = strTag[127];
        }
    }  
    return tag;
}


HTH

- Nick Parker
My Blog | My Articles

QuestionInstall problem? Pin
Yulianto.23-Oct-04 16:51
Yulianto.23-Oct-04 16:51 
GeneralHelp please Pin
Yulianto.23-Oct-04 16:48
Yulianto.23-Oct-04 16:48 
GeneralRe: Help please Pin
Alex Korchemniy24-Oct-04 9:22
Alex Korchemniy24-Oct-04 9:22 
GeneralClone a copy of System.WIndows.Forms.Panel Pin
hoho_leung23-Oct-04 13:16
hoho_leung23-Oct-04 13:16 
GeneralRe: Clone a copy of System.WIndows.Forms.Panel Pin
Alex Korchemniy23-Oct-04 13:32
Alex Korchemniy23-Oct-04 13:32 
General.net style Pin
tom_dx23-Oct-04 11:35
tom_dx23-Oct-04 11:35 
GeneralRe: .net style Pin
Alex Korchemniy23-Oct-04 13:39
Alex Korchemniy23-Oct-04 13:39 
QuestionDisposing a form in another thread? Pin
Carl Mercier23-Oct-04 7:11
Carl Mercier23-Oct-04 7:11 
AnswerRe: Disposing a form in another thread? Pin
Carl Mercier23-Oct-04 7:30
Carl Mercier23-Oct-04 7:30 
GeneralRe: Disposing a form in another thread? Pin
Dennis C. Dietrich23-Oct-04 9:19
Dennis C. Dietrich23-Oct-04 9:19 
QuestionHow to get absolute value of the pixel cordinates using mouse position Pin
Anonymous23-Oct-04 6:48
Anonymous23-Oct-04 6:48 
AnswerRe: How to get absolute value of the pixel cordinates using mouse position Pin
Alex Korchemniy23-Oct-04 12:33
Alex Korchemniy23-Oct-04 12:33 
GeneralRefresh DataGrid question Pin
markdbd23-Oct-04 6:21
markdbd23-Oct-04 6:21 
GeneralRe: Refresh DataGrid question Pin
Alex Korchemniy23-Oct-04 12:40
Alex Korchemniy23-Oct-04 12:40 
GeneralRe: Refresh DataGrid question Pin
markdbd24-Oct-04 2:13
markdbd24-Oct-04 2:13 
GeneralRe: Refresh DataGrid question Pin
Alex Korchemniy24-Oct-04 9:08
Alex Korchemniy24-Oct-04 9:08 
GeneralCalling an event Pin
Anonymous23-Oct-04 5:46
Anonymous23-Oct-04 5:46 

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.