1using System;
2 using System.Runtime.InteropServices;
3
4 namespace TestPInvoke
5 {
6 /// <summary>
7 /// Summary description for Class1.
8 /// </summary>
9 class WrapK32
10 {
11 [DllImport("kernel32.dll")]
12 public static extern bool Beep(int frequency, int duration);
13 /// <summary>
14 /// The main entry point for the application.
15 /// </summary>
16 [STAThread]
17 static void Main(string[] args)
18 {
19 //
20 // TODO: Add code to start application here
21 //
22 Random random = new Random();
23
24 for (int i = 0; i < 10000; i++)
25 {
26 Beep(random.Next(10000), 100);
27 }
28 }
29 }
30 }