Using the Code

  1. Add a textbox named 'txtWords' to a form.
  2. Add a button named 'btnSpeak' to a form.
  3. Add a reference to System.Speech.
  4. In the form's code-behind, add:
    Collapse | Copy Code
    using System.Windows.Forms;
    using System.Speech.Synthesis; namespace Sample
    {
    public partial Class Form1: Form
    {
    public SpeechSynthesizer _synthesizer;
    private void btnSpeak_Click(object sender, EventArgs e)
    {
    _synthesizer = new SpeechSynthesizer();
    var words = txtWords.Text;
    _synthesizer.Speak(Words);
    }
    public Form1()
    {
    InitializeComponent();
    }
    }
    }
  5. Run. Text entered into the textbox will be spoken by the computer.

Computer Talker with C# z的更多相关文章

  1. Windows2008当桌面使用

    因为需要32位系统,又想用8G内存. 一.提高开机速度   0 |" t7 A- d! `- A- R5 | 1.免除登录时按Ctrl+Alt+Del的限制 打开<开始> - & ...

  2. 20175226 2018-2019-2 《Java程序设计》第四周学习总结

    20175226 2018-2019-2 <Java程序设计>第四周学习总结 教材学习内容总结 子类与父类 格式class 子类名 extends 父类名 Object类是所有类的祖先类 ...

  3. 【Python】使用torrentParser1.03对多文件torrent的分析结果

    Your environment has been set up for using Node.js 8.5.0 (x64) and npm. C:\Users\horn1>cd C:\User ...

  4. hdu 3695:Computer Virus on Planet Pandora(AC自动机,入门题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  5. Computer Graphics Research Software

    Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...

  6. ACM: Gym 100935F A Poet Computer - 字典树

    Gym 100935F A Poet Computer Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d &am ...

  7. HDU 3695 Computer Virus on Planet Pandora(AC自动机模版题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  8. hdu ----3695 Computer Virus on Planet Pandora (ac自动机)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  9. 【转载】shell编程——if语句 if -z -n -f -eq -ne -lt

    shell编程中条件表达式的使用 if  条件then Commandelse Commandfi                              别忘了这个结尾 If语句忘了结尾fites ...

随机推荐

  1. Executing System commands in Java---ref

    One of the nice features of Java language is that it provides you the opportunity to execute native ...

  2. linux监控程序

    IP内部地址: 方法一:ifconfig |grep 'inet addr'|grep '192.168.1' | awk '{print $2}'| tr -d "addr:" ...

  3. 读写应用程序数据-SQLite3

    SQLite3是嵌入到ios中的关系型数据库.对存储大规模的数据非常实用,使得不必将每个对象加到内存中. 支持NULL.INTEGER.REAL(浮点数字).TEXT(字符串和文本).BLOB(二进制 ...

  4. iOS VoiceOver Programming Guide

    VoiceOver是苹果“读屏”技术的名称,属于辅助功能的一部分.VoiceOver可以读出屏幕上的信息,以帮助盲人进行人机交互. 这项技术在苹果的各个系统中都可以看到,OS X,iOS,watchO ...

  5. 路径MTU

    数据在以太网中的传输有长度有一个限制,其最大值一般情况下是1500字节.链路层的这个特性叫作MTU,也就是最大传输单元.不同类型的网络会有所不同的.如果IP层有一个数据报要传输,而且数据的长度比链路层 ...

  6. Java中创建线程的两种方式

    创建线程的第一种方式: 创建一个类继承Thread 重写Thread中的run方法 (创建线程是为了执行任务 任务代码必须有存储位置,run方法就是任务代码的存储位置.) 创建子类对象,其实就是在创建 ...

  7. Objective-C:runtime

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css); @import url(/ ...

  8. IEnumerable 和 IQueryable

    共有两组 LINQ 标准查询运算符,一组在类型为 IEnumerable<T> 的对象上运行,另一组在类型为 IQueryable<T> 的对象上运行.构成每组运算符的方法分别 ...

  9. Apache Commons Beanutils对象属性批量复制(pseudo-singleton)

    Apache Commons Beanutils为开源软件,可在Apache官网http://commons.apache.org/proper/commons-beanutils/download_ ...

  10. MVC小系列(七)【分部视图中的POST】

    MVC小系列(七)[分部视图中的POST] 在PartialView中进行表单提交的作用:1 这个表单不止一个地方用到,2 可能涉及到异步的提交问题 这两种情况都可能需要把表单建立在分部视图上, 使用 ...