?? c#朗讀英文.txt
字號:
先在C盤下找到sapi.dll文件,添加的引用
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SpeechLib;
namespace WindowsApplication1
...{
public partial class Form1 : Form
...{
public Form1()
...{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
...{
try
...{
SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
SpVoice voice = new SpVoice();
if (this.richTextBox1.Text.Trim() == string.Empty)
...{
voice.Speak("請輸入數據!", spFlags);
}
else
...{
voice.Speak(this.richTextBox1.Text, spFlags);
}
}
catch (Exception Err)
...{
MessageBox.Show(Err.Message);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -