using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Media;
using System.Resources;
using System.IO;
namespace SoundPlayerApp
{
public partial class Form1 : Form
{
private SoundPlayer simpleSound;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
OpenFileDialog1.Filter = "Wav 文件(*.wav)|*.wav";
if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
{
simpleSound = new SoundPlayer(OpenFileDialog1.FileName);
simpleSound.Play();
}
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
OpenFileDialog1.Filter = "Wav 文件(*.wav)|*.wav";
if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
{
simpleSound = new SoundPlayer(OpenFileDialog1.FileName);
simpleSound.PlayLooping();
}
}
private void button3_Click(object sender, EventArgs e)
{
if (simpleSound != null) simpleSound.Stop();
}
private void button4_Click(object sender, EventArgs e)
{
simpleSound = new SoundPlayer(Properties.Resources.big);
simpleSound.Play();
}
private