반응형

* C# PC 비프음 (Beep) 예제...

 

전체 소스 코드

Form1.cs

 

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;

namespace CSharp_PCBeep
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            Console.Beep(262, 400); //도
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            Console.Beep(294, 400); //레
        }

        private void Button3_Click(object sender, EventArgs e)
        {
            Console.Beep(330, 400); //미
        }

        private void Button4_Click(object sender, EventArgs e)
        {
            Console.Beep(349, 400); //파
        }

        private void Button5_Click(object sender, EventArgs e)
        {
            Console.Beep(392, 400); //솔
        }

        private void Button6_Click(object sender, EventArgs e)
        {
            Console.Beep(440, 400); //라
        }

        private void Button7_Click(object sender, EventArgs e)
        {
            Console.Beep(494, 400); //시
        }

        private void Button8_Click(object sender, EventArgs e)
        {
            Console.Beep(523, 400); //도
        }
    }
}

 

 

 

반응형

+ Recent posts