我写了一个     
   /// <summary>
        /// APIFunctions 包含系统中对API的调用的类
        /// </summary>
        //public class APIFunctions
        //{
        //    /// <summary>
        //    /// PCI喇叭的频率
        //    /// </summary>
        //    public const int FREQ = 2000;
        //    /// <summary>
        //    /// PCI喇叭的持续时间
        //    /// </summary>
        //    public const int DURATION = 1000;        //    [DllImport("kernel32.dll", EntryPoint = "Beep")]
        //    public static extern int Beep(int dwFreq, int dwDuration);        //    /// <summary>
        //    /// 通过此方法发出声音通知用户
        //    /// </summary>
        //    public static void CollateBeep()
        //    {
        //        Beep(FREQ, DURATION);
        //    }
        //}
这个是服务器端发出的警报声,  我现在想客户在浏览的时候从客户端发出警报

解决方案 »

  1.   

    你的客户端调用怎么写的啊,服务器端返回的是正确与否的状态,客户端调用一个wav等声音文件即可
      

  2.   

    这是调用:
    if (textBox2.Text.Trim().Contains("On-Line"))
                {
                    Label1.Text = "正常供电!";                APIFunctions.CollateBeep();               
                }
    是一个页面的调用,  可是调用的这个方法只会是服务器端发出声音,,,  我现在是想让客户端能够听到声音,,这样写可以么: Response.Write("<embed src='sound/KnowingMeKnowingYou.mid'  hidden='true'/>");
      

  3.   

    Beep  不需要导入win32 api,
    直接使用 Console.Beep
      

  4.   

    Response.Write("<embed src='sound/KnowingMeKnowingYou.mid' style='display:none'></embed>");是可以的