• 大小: 2.33M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-27
  • 语言: C#
  • 标签: demo  Piano  OD  AI  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MechanicalPiano1._0
{
    public partial class Form1 : Form
    {
        string MusicPath = ““;
        public Form1()
        {
            InitializeComponent();
        }
        #region//调用windows库
        [DllImport(“Kernel32.dll“)]
        public static extern bool Beep(int frequency int duration);//蜂鸣器发声
        #endregion
        private void Form1_Load(object sender EventArgs e)
        {

            string path = System.Environment.CurrentDirectory;
            path = path.Substring(0 path.LastIndexOf(“\\“));
            MusicPath = path + “\\music\\“;
            //MediaPlayer1.Ctlcontrols.stop();        //停止
            //MediaPlayer1.Ctlcontrols.pause();       //暂停
        }


        private void Form1_KeyDown(object sender KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)//
            {
                MediaPlayer27.Ctlcontrols.stop();        //停止
                MediaPlayer27.URL = MusicPath + “27.mp3“;
                MediaPlayer27.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F1)
            {
                MediaPlayer28.Ctlcontrols.stop();        //停止
                MediaPlayer28.URL = MusicPath + “28.mp3“;
                MediaPlayer28.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F2)
            {
                MediaPlayer30.Ctlcontrols.stop();        //停止
                MediaPlayer30.URL = MusicPath + “30.mp3“;
                MediaPlayer30.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F3)
            {
                MediaPlayer32.Ctlcontrols.stop();        //停止
                MediaPlayer32.URL = MusicPath + “32.mp3“;
                MediaPlayer32.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F4)
            {
                MediaPlayer33.Ctlcontrols.stop();        //停止
                MediaPlayer33.URL = MusicPath + “33.mp3“;
                MediaPlayer33.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F5)
            {
                MediaPlayer35.Ctlcontrols.stop();        //停止
                MediaPlayer35.URL = MusicPath + “35.mp3“;
                MediaPlayer35.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F6)
            {
                MediaPlayer37.Ctlcontrols.stop();        //停止
                MediaPlayer37.URL = MusicPath + “37.mp3“;
                MediaPlayer37.Ctlcontrols.play();        //播放
            }
            if (e.KeyCode == Keys.F7)
            {
                MediaPlayer39.Ctlcontrols.stop();        //停止
                Med

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1023  2020-09-09 19:03  MechanicalPiano1.0\MechanicalPiano1.0.sln
     文件       43520  2020-09-14 23:27  MechanicalPiano1.0\MechanicalPiano1.0.v12.suo
     目录           0  2020-11-03 20:56  MechanicalPiano1.0\MechanicalPiano1.0\
     文件         187  2020-09-09 19:03  MechanicalPiano1.0\MechanicalPiano1.0\App.config
     目录           0  2020-11-03 20:56  MechanicalPiano1.0\MechanicalPiano1.0\bin\
     目录           0  2020-11-03 20:56  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\
     文件       53760  2020-09-09 21:45  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\AxInterop.WMPLib.dll
     文件      330752  2020-09-09 21:44  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\Interop.WMPLib.dll
     文件       94208  2020-09-12 00:32  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.exe
     文件         187  2020-09-09 19:03  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.exe.config
     文件       46592  2020-09-12 00:32  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.pdb
     文件       24224  2020-09-14 23:19  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.vshost.exe
     文件         187  2020-09-09 19:03  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.vshost.exe.config
     文件         490  2019-03-19 12:47  MechanicalPiano1.0\MechanicalPiano1.0\bin\Debug\MechanicalPiano1.0.vshost.exe.manifest
     目录           0  2020-11-03 20:56  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\
     文件       69509  2011-05-29 13:48  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\01.mp3
     文件       63947  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\02.mp3
     文件       70635  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\03.mp3
     文件       31346  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\04.mp3
     文件       31346  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\05.mp3
     文件       32600  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\06.mp3
     文件       30511  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\07.mp3
     文件       31764  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\08.mp3
     文件       29257  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\09.mp3
     文件       29675  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\10.mp3
     文件       30093  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\11.mp3
     文件       30093  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\12.mp3
     文件       30929  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\13.mp3
     文件       30511  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\14.mp3
     文件       28839  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\15.mp3
     文件       30093  2011-05-29 13:46  MechanicalPiano1.0\MechanicalPiano1.0\bin\music\16.mp3
............此处省略102个文件信息

评论

共有 条评论