下载media player 9的sdk和文档,微软网站有

解决方案 »

  1.   

    sdk?
    不会吧~~~~~能不能给我个实例看看呀?
      

  2.   

    http://www.microsoft.com/china/msdn/library/dnwmt/html/WMPlayer_9_SDK_Intro.asp#wmplayer_9_sdk_intro_topic1
      

  3.   

    SDK里都是VC++6的例子,怎么转到C#中去呢?
      

  4.   


            // The following code executes everytime the click event is fired.
            // This provides play/pause functionality when the user clicks 
            // the "Play" button.
            private void btnPlay_Click(object sender, System.EventArgs e)
            {            if (Player.playState == WMPPlayState.wmppsPlaying)
                {
                    pause();
                }
                else
                {
                    playClip();
                }
            }        // When the Click event is fired on the Stop button, the following code
            // checks if the Player is playing, and if so, it stops the player,
            // sets the value for the progress bar to the start of the current clip
            // and updates the UI.
            private void btnStop_Click(object sender, System.EventArgs e)
            {   
                if (Player.playState == WMPPlayState.wmppsPlaying)
                {
                    stop();
                    songTrackBar.Value = ((Clip)clipArray[currentClip]).startSeconds;
                    updateCurrentPositionText();
                }
            }        // When the Click event is fired on the "Add..." button, the
            // open file dialog box opens and any media items that the user 
            // selects are added into a playlist and clipArray for use by 
            // the application.
            private void btnAddFile_Click(object sender, System.EventArgs e)
            {
                // Open a File dialog window.
                openFileDialog1.ShowDialog(this);
                
                for (int i = 0; i < openFileDialog1.FileNames.Length; i++)
                {
                    // Store songs selected through the file dialog window
                    // into the "media" playlist.
                    Playlist.appendItem(Player.newMedia(
                        openFileDialog1.FileNames.GetValue(i).ToString()));                // Add a new clip object to clipArray for every new clip created.
                    clipArray.Add(new Clip());                // Create a temporary Clip object to make the code more readable.
                    Clip tempClip = (Clip)clipArray[Playlist.count - 1];                // Assign all the member variables for the current clip object.
                    tempClip.mediaName = Playlist.get_Item(Playlist.count - 1).name;
                    tempClip.mediaURL = Playlist.get_Item(Playlist.count - 1).sourceURL;
                    tempClip.startSeconds = 0;
                    tempClip.startString = "00:00";
                    tempClip.endString = Playlist.get_Item(Playlist.count - 1).durationString;
                    tempClip.endSeconds = (int)(Math.Ceiling(Playlist.get_Item(Playlist.count - 1).duration));                // Update the listbox.
                    updateClip(Playlist.count - 1);
                }
            }        private void btnStart_Click(object sender, System.EventArgs e)
            {
                CurrentClip(START);
            }        private void btnEnd_Click(object sender, System.EventArgs e)
            {
                CurrentClip(END);
            }        private void btnUp_Click(object sender, System.EventArgs e)
            {
                moveSelectedClip(UP);
            }        private void btnDown_Click(object sender, System.EventArgs e)
            {
                moveSelectedClip(DOWN);
            }        private void btnDelete_Click(object sender, System.EventArgs e)
            {
                deleteSelectedClip();
            }        private void btnClear_Click(object sender, System.EventArgs e)
            {
                clearClipList();
            }        // In the following code, the current media stops playing and the selected clip 
            // begins playing when the DoubleClick event is fired.
            private void bxClipList_DoubleClick(object sender, System.EventArgs e)
            {
                stop();
                playClip();
            }        // When the Click event is fired on the "Clear Markers" button, the following code
            // resets the current clip back to it's default state, and updates the UI.
            private void btnClearMarkers_Click(object sender, System.EventArgs e)
            {
                stop();
                SetDefaultState(((Clip)clipArray[bxClipList.SelectedIndex]));
                updateClip(bxClipList.SelectedIndex);
                updateCurrentPositionText();
                bxClipList.SetSelected(currentClip, true);
            }        // The following code toggles the sequential functionality on and 
            // off whenever the CheckChanged event is fired in the "Sequential" checkbox.
            private void bxSequential_CheckedChanged(object sender, System.EventArgs e)
            {
                if (bxSequential.Checked)
                {
                    sequential = true;
                }
                else
                {
                    sequential = false;
                }
            }