[Csharp] Ejecutando el sonido Beep en una aplicación Windows Forms con C#

  • RSS
  • Add To My MSN
  • Add To Windows Live
  • Add To My Yahoo
  • Add To Google

Statistics

  • Entries (27)
  • Comments (55)
Posted by samuelarellanonet Sunday, February 12, 2012 5:55:54 PM

 

Qué tal mi estimados lectores, en esta ocasión me gustaría compartirles como pueden ejecutar el sonido Beep en una aplicación de tipo Windows Forms utilizando el lenguaje de programación C#. Como recordarán, anteriormente las computadoras ejecutaban un sonido peculiar por la bocina que incluían, ese era conocido como el Beep.

Para efectuar esta tarea en Visual Studio 2010, será necesario realizar los siguientes pasos:

1. Una vez que se encuentre en Visual Studio 2010, seleccionar la plantilla de Windows Forms Application

beep1

 

2. Colocarle un nombre a la aplicación, en este caso le pondré AppSonidoBeep y presionar OK.

beep2

3. Dentro del proyecto de Windows Forms, será necesario incluir un botón, el cual se encuentra en el toolbox de VS2010, y arrastrarlo a la forma. Deberá de quedar similar a como aparece en la siguiente imágen.

image

 

4. Colocarle un nombre al botón. Como recomendación, es bueno colocarle las siglas btn para referirnos a que se trata de un Button, seguido del nombre de la acción a ejecutar, por ejemplo Reproducir. Por lo tanto quedaría como btnReproducir, dentro de la propuedad nombre, la cual se encuentra dentro de Properties en nuestro VS2010.

image

5. Posteriormente habrá que incluir la sentencia en C# que aparece a continuación

private void btnReproducir_Click(object sender, EventArgs e)
        {
            Console.Beep();
        }

 

6. Ejecutamos la aplicación, y ya podemos escuchar aquél sonido de los 90’s jeje.

Saludos,

Samuel Arellano

Comments

Monday, February 13, 2012 1:29:57 AM
Yo

re: [Csharp] Ejecutando el sonido Beep en una aplicación Windows Forms con C#

using System;
class Beep
{
public static void Main (string [] args){
Console.Beep();
}
}

Siempre tenemos nuestro notepad.exe para lo más simple :)...

csc Beep.cs

 

 

Thursday, April 12, 2012 12:03:59 AM

This is an interesting read. I wish I came cosars it before committing to yellowpages.com, I would

This is an interesting read. I wish I came cosars it before committing to yellowpages.com, I would have gone with the printed Yellow Pages ad instead. But I will see how that turns out when the ad starts appearing online. At least the package I bought will give me first page results on Yellowpages.com and their partner yellow page directories like yahoo yellow pages, mapquest etc Do you think this will work at all? I live in a fairly heavily populated area, at least a few 100,000 people within my service area. My business is on site Mac, Windows and network repairs. It needs to generate 35+ hours per week as I have no employees and have no shop.I have been struggling to get hits on adwords because of the price I can not afford the front page adwords hit. Craigslist gets some calls but those people expect repairs to cost practically nothing.At least most of my customers have more than one computer in the house. So they can check online if there main computer fails.
Comments are closed on this post.
© 2009 - 2013 Avanet