It's spring break, so let's beep in C# code, actually a 440 Hz A. We are just borrowing the Beep() function from the Windows kernel.

// using InteropServices
// the necessary WinApi functions are in kernel32.dll
// in C# Handle = IntPtr  DWORD = uint   WORD = int
// just a console program compiled with:
// C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe

using System;
using System.Runtime.InteropServices;  // DllImport()

class Class1
{
  // WinApi Beep() is in kernel32.dll  
  [DllImport("kernel32")]
  private static extern int Beep(int dwFreq, int dwDuration);

  static void Main(string[] args)
  {
    Console.WriteLine("It's spring time so let's beep!!!!\n\n");
        
    int freq = 440;      // hertz
    int duration = 2000;  // milliseconds
    Console.WriteLine("Beeping at " + freq + " Hz for " + duration + " milliseconds");
    Beep(freq, duration);
  }
}

Awesome I modified it sent it to my friend and it said
"If your computer beeps it has a virus" and he went nuts I did tell him the truth (after half hour)

Cheers

HLA91

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.