[转载]C# 跨线程调用TextBox方法浅析
摘要:首先来看下面代码: 主线程: delegate void SetTextCallback(string text); private void SetText(string text) { if (this.textBox1.InvokeRequired) { SetTextCallback d = new SetTextCallback(SetText); this.Invoke(d, new ...
阅读全文
posted @
2011-01-18 12:14
guoxuefeng
阅读(673)
推荐(0)
[转载]System.Speech.Recognition(语音识别)
摘要:虽然您可以在应用程序中使用通用听写语言模型,但是很快您将遇到大量应用程序开发困难,它们是关于如何处理识别结果的。例如,以比萨饼定购系统为例。用户可能说“I'd like a pepperoni pizza”,结果将包含该字符串。但是它也可能包含“I'd like pepper on a plaza”,或者很多发音类似的语句,这取决于用户的发音差别或背景噪音情况。同样,用户可能说“Mary had a little lamb”,而结果将包含它,即使它对于比萨饼定购系统毫无意义。所有这些错误的结果对于应用程序而言毫无用处。因此,应用程序应该始终提供专门描述应用程序所要听到内容的语法。在图 8 中,
阅读全文
posted @
2011-01-14 14:13
guoxuefeng
阅读(7599)
推荐(2)
System.Speech.Synthesis(语音合成器)
摘要:System.Speech.Synthesis让我们看一下关于如何从托管应用程序使用语音合成的示例。作为最典型的一个 UI 输出示例,我将从只说出“Hello, world”的应用程序开始,如图 5 所示。该示例是一个明显的控制台应用程序,是最近使用 Visual C#® 创建的,其中添加了三行代码。所添加的第一行只引入 System.Speech.Synthesis 命名空间。第二行声明并实例化 SpeechSynthesizer 的实例,它准确表示了其名称的含意:语音合成器。所添加的第三行是对 SpeakText 的调用。这是调用合成器所需的全部。默认情况下,SpeechSynthesiz
阅读全文
posted @
2011-01-14 12:28
guoxuefeng
阅读(13522)
推荐(3)
让程序通过windows的防火墙
摘要:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { ...
阅读全文
posted @
2011-01-11 10:37
guoxuefeng
阅读(668)
推荐(0)
dataReader转换成Datatable,中间还有数据的类型
摘要:/// summary /// 用于把dataReader转换成DataTable /// /summary /// param name="dataReader"/param /// returns/returns public DataTable DataReaderToDataTable(...
阅读全文
posted @
2010-12-22 11:08
guoxuefeng
阅读(397)
推荐(0)
关于房态图的制作方法(C#)
摘要:效果图如上,代码如下 private void Form3_Load(object sender, EventArgs e) { for (int i = 0; i 30; i++) { // Label lb = new Label(); Button lb = new Button(); lb.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); lb.Width = 80; lb.Height = 80; lb.Text = i.ToString("000"); lb.BackColor = Color.PowderBlue;
阅读全文
posted @
2010-04-07 21:09
guoxuefeng
阅读(1302)
推荐(2)