can you explain this code which is used in microsoft vs 2010 RRS feed

  • Question

  •  protected void dfgsdf(object sender, EventArgs e)
            string msg = ((Button)sender).CommandArgument;

            SpVoice objspeach = new SpVoice();
            objspeach.Speak(msg, SpeechVoiceSpeakFlags.SVSFDefault);
    Wednesday, May 8, 2013 12:10 AM


  • In a nutshell, it uses Text-To-Speech to make the computer say aloud the CommandArgument associated to a Button.

    Now, that code runs on the server, not the client, which makes me think this was designed as a rather convoluted (and inefficient) way to debug an application. Bonus points for originality, though...

    Just make sure this never hits a production server; leaving alone the performance hit, you could spook someone in the server room... :)


    Wednesday, May 8, 2013 12:34 AM