i got it my self.....
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string[] fileEntries = null;
bool nextsong;
private void button1_Click_1(object sender, EventArgs e)
{
timer1.Start();
comboBox1.Items.Clear();
folderBrowserDialog1.ShowDialog();
fileEntries = Directory.GetFiles(folderBrowserDialog1.SelectedPath);
foreach (string filename in fileEntries)
{
string path1 = folderBrowserDialog1.SelectedPath;
string path2 = "desktop.ini";
string outpath = Path.Combine(path1, path2);
if (filename == outpath)
{
fileEntries[0] = null;
}
else
{
string I = Path.GetFileName(filename);
comboBox1.Items.Add(I);
WMP.URL = fileEntries[1];
comboBox1.Text = Path.GetFileName(fileEntries[1]); ;
}
}
}
private void button2_Click(object sender, EventArgs e)
{
}
int playing = 2;
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
playing = comboBox1.SelectedIndex;
playing++;
WMP.URL = fileEntries[playing];
nextsong = false;
}
int sikkerhed_for_musik_skrift = 1;
private void WMP_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
if (nextsong == true && fileEntries.Length > (playing + 1) && sikkerhed_for_musik_skrift == 1 )
{
playing++;
nextsong = false;
WMP.URL = fileEntries[playing];
}
if (nextsong == true )
{
nextsong = false;
sikkerhed_for_musik_skrift = 0;
playing = 2;
WMP.URL = fileEntries[1];
}
if (WMP.status == "Ready")
{
try
{
WMPLib.IWMPControls3 controls = (WMPLib.IWMPControls3)WMP.Ctlcontrols;
controls.play();
}
catch
{
}
}
comboBox1.Text = Path.GetFileName(fileEntries[playing]);
}
private void timer1_Tick(object sender, EventArgs e)
{
nextsong = true;
sikkerhed_for_musik_skrift = 1;
}
}
}