winform下能实现,但在aspx为何不能实现呢?
在winform下能实现,但在aspx为何不能实现呢?
form.cs
上面能得到结果
aspx.cs
下面这个却没有得到CurrentVisemeId这是为什么呢
winform下面和aspx.net的委托机制不一样吗
为什么后者没有事件触发
谢谢各位先啦
form.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SpeechLib;
namespace pro2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SpeechLib.SpVoice Voice = new SpVoiceClass();
private void Form1_Load(object sender, EventArgs e)
{
Voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(Voice_Viseme);
}
private void button1_Click(object sender, EventArgs e)
{
Voice.Speak(textBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
void Voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
{
label1.Text += "CurrentVisemeId:" + CurrentVisemeId.ToString() + "\n";
}
}
}
上面能得到结果
aspx.cs
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SpeechLib;
namespace myspeak
{
public partial class MySpeak : System.Web.UI.Page
{
SpeechLib.SpVoice Voice = new SpVoiceClass();
protected void Page_Load(object sender, EventArgs e)
{
Voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(Voice_Viseme);
}
void Voice_Viseme(int StreamNumber, object StreamPosition, int Duration, SpeechVisemeType NextVisemeId, SpeechVisemeFeature Feature, SpeechVisemeType CurrentVisemeId)
{
lbl.Text += "Voice_Viseme:" + CurrentVisemeId.ToString();
}
protected void Button1_Click1(object sender, EventArgs e)
{
Voice.Speak("hello", SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
}
}
下面这个却没有得到CurrentVisemeId这是为什么呢
winform下面和aspx.net的委托机制不一样吗
为什么后者没有事件触发
谢谢各位先啦
...全文
相关推荐
C# winform实现表数据导出到Excel表格
在项目文件"OutputExcel"中,可能包含了实现这些功能的源代码文件,如.cs文件(C#代码)和.aspx文件(用于用户界面)。
c# 初级笔试题
Winform中ToolBar控件的常用属性有哪些?
C#WEBform和WINform之间通信.doc
这些数据被编码为URL查询字符串的形式:```csharpSystem.Diagnostics.Process.Start(@"http://localhost:4123/WebForm1.aspx?
基于winForm的点餐系统
这部分通常由WinForm控件构成,如按钮、文本框、列表视图等,用于展示菜单、接收用户输入并处理订单。开发者需要掌握WinForm的设计原则和事件驱动编程模型,以实现动态响应用户操作。
Winform实现调用asp.net数据接口实例
### 总结本文通过一个具体的实例,演示了如何在Winform应用中调用ASP.NET数据接口,实现跨平台的数据交互。


