vb点虐 语音聊天 vb聊天代码-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

vb点虐 语音聊天 vb聊天代码

VB点虐 如何使用Microsoft Speech SDK5.1

安装了sdk后应该可以在控件箱单击鼠标右键,然后选择部件,在弹出的列表中应该可以找到microsoft tts engine或之类的东西,选择后就可以吧tts engine作为控件放到窗体上。 调用貌似是用.speak(String)实现的。 由于我是很久以前用的,所以也记得不是很清楚了,你可以找找看。

公司主营业务:成都网站建设、网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。成都创新互联公司是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。成都创新互联公司推出厦门免费做网站回馈大家。

有谁搞过vb点虐 或c#给QQ好友发信息的?怎样实现的,能不能说说

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Security.Cryptography;

using System.Diagnostics;

namespace QQLogin

{

public partial class QQLoginForm : Form

{

public QQLoginForm()

{

InitializeComponent();

}

UserInfo ui;

private void button1_Click(object sender, EventArgs e)

{

//单用户登陆

if (ui == null)

{

ui = new UserInfo();//如果没有提取出来对象,就创建一个

}

if (ui != null)

{

ui.Username = this.txtUser.Text.Trim();

ui.Password = this.txtPwd.Text;

ui.Type = this.cboType.Text == "正常" ? "41" : "40";

if (this.ValidateInput())

{//验证是否输入完全

if (string.IsNullOrEmpty(ui.Path))

{//判断是否有QQ路径,如果没有就打开对话框来选择一下

DialogResult dr = this.opfQQ.ShowDialog();

if (dr == DialogResult.OK)

{

ui.Path = opfQQ.FileName;//将选择的路径赋值给对象

this.LoginQQ(ui.Username, ui.Password, ui.Type, ui.Path);//登陆QQ

}

}

else

{

this.LoginQQ(ui.Username, ui.Password, ui.Type, ui.Path);

}

}

SerializeHelper.SerializeUserInfo(ui);//每次登陆都序列化保存一次

}

}

private bool ValidateInput()

{//验证是否输入完整

if (this.txtUser.Text == "")

{

this.txtUser.Focus();

return false;

}

else if(this.txtPwd.Text=="")

{

this.txtPwd.Focus();

return false;

}

return true;

}

private void LoginQQ(string user,string pwd,string type,string path)

{//登陆QQ的命令,通过CMD命令来执行

Process MyProcess = new Process();

//设定程序名

MyProcess.StartInfo.FileName = "cmd.exe";

//关闭Shell的使用

MyProcess.StartInfo.UseShellExecute = false;

//重定向标准输入

MyProcess.StartInfo.RedirectStandardInput = true;

//重定向标准输出

MyProcess.StartInfo.RedirectStandardOutput = true;

//重定向错误输出

MyProcess.StartInfo.RedirectStandardError = true;

//设置不显示窗口

MyProcess.StartInfo.CreateNoWindow = true;

//执行强制结束命令

MyProcess.Start();

MyProcess.StandardInput.WriteLine(path+" /start QQUIN:"+user+" PWDHASH:" + EncodeHash.pwdHash(pwd) + " /stat:"+type);//直接结束进程ID

MyProcess.StandardInput.WriteLine("Exit");

}

private void btnExit_Click(object sender, EventArgs e)

{

Application.Exit();

}

private void txtUser_KeyPress(object sender, KeyPressEventArgs e)

{

if ((e.KeyChar '0' || e.KeyChar '9')e.KeyChar!=8)

{//只能输入数字和退格键

e.Handled = true;

}

}

private void QQLoginForm_Load(object sender, EventArgs e)

{

LoadInfo();//单用户获取

}

private void LoadInfo()

{//单用户获取

ui = SerializeHelper.DeserializeUserInfo();//返回获取后对象

if (ui != null)

{

this.txtUser.Text = ui.Username;//填充文本框

this.txtPwd.Text = ui.Password;//填充密码框

this.cboType.SelectedIndex = ui.Type == "41" ? 0 : 1;//选择登陆方式

}

else

{

this.cboType.SelectedIndex = 0;

}

}

private void btnConfig_Click(object sender, EventArgs e)

{

ConfigForm cf = new ConfigForm();

cf.ShowDialog();

LoadInfo();

}

}

}

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace QQLogin

{

public partial class ConfigForm : Form

{

UserInfo ui;

public ConfigForm()

{

InitializeComponent();

}

private void txtPath_Click(object sender, EventArgs e)

{//点击一次文本框,弹出一次对话框来选择QQ路径

DialogResult dr = this.opfQQ.ShowDialog();

if (dr == DialogResult.OK)

{

this.txtPath.Text = opfQQ.FileName;

}

}

private bool ValidateInput()

{//验证是否输入完整

if (this.txtUser.Text == "")

{

this.txtUser.Focus();

return false;

}

else if (this.txtPwd.Text == "")

{

this.txtPwd.Focus();

return false;

}

else if (this.txtPath.Text == "")

{

return false;

}

return true;

}

private void btnCancel_Click(object sender, EventArgs e)

{

this.Close();

}

private void ConfigForm_Load(object sender, EventArgs e)

{

LoadInfo();

}

private void btnSave_Click(object sender, EventArgs e)

{

ui = new UserInfo();

ui.Username = this.txtUser.Text.Trim();

ui.Password = this.txtPwd.Text;

ui.Type = this.cboType.Text == "正常" ? "41" : "40";

ui.Path = this.txtPath.Text;

if (this.ValidateInput())

{

SerializeHelper.SerializeUserInfo(ui);

this.Close();

}

}

private void LoadInfo()

{

ui = SerializeHelper.DeserializeUserInfo();

if (ui != null)

{

this.txtUser.Text = ui.Username;

this.txtPwd.Text = ui.Password;

this.cboType.SelectedIndex = ui.Type == "41" ? 0 : 1;

this.txtPath.Text = ui.Path;

}

else

{

this.cboType.SelectedIndex = 0;

}

}

}

}

想在vb点虐 的程序中有一个语音提示,该怎么写

首先添加一个系统的语音COM组件的引用microsoft speech object library然后在程序中声明一个语音类dim RC As SpeechLib.SpSharedRecoContext这个类有一些事件,如果你要处理它的一些事件,可以用withevent来声明然后在窗体LOAD事件或你需要的地方先创建一个实例RC = New SpeechLib.SpSharedRecoContext当一个RC被实例化后,系统就会运行语音识别程序.前提是你的系统已经正确安装这个功能.一般默认就已经安装好的.其次提醒一下,WIN7的语音识别比XP的好N倍.从阅读到侦听都好很多.然后就可以在你需要阅读的地方使用RC.Voice.Speak("hello 我", 11)11那里是一些枚举,用来标识系统用前台还是后台或其他方式来阅读文字,简单的来说就是阅读的时候不会卡住你的程序.你可以选其他的枚举来试试作用.以上为阅读部分.如果需要程序听你说话,则需要声明一个侦听类dim RG As SpeechLib.ISpeechRecoGrammar在初始化时将之与上面的RC建立关系,此时则必须要用withevent来声明上面的RC,因为涉及电脑听到你的语音后,会触发一个事件,并将听到的内容传递到该事件.其次,要让系统听到的解析为命令,就必须准备一个XML结构的文件来保存那些固定的命令.如果电脑在XML文件中找不到那些固定命令或同时不属于系统命令,电脑将会将其解释为听写.RG = RC.CreateGrammar '(0)

RG.CmdLoadFromFile("听到.xml", SpeechLib.SpeechLoadOption.SLODynamic)

RG.CmdSetRuleIdState(0, SpeechLib.SpeechRuleState.SGDSActive)然后写一个过程来处理听到的事件Private Sub 听到命令(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal 话语 As SpeechLib.ISpeechRecoResult) Handles RC.Recognition RC.Voice.Speak("我听到了" 话语.PhraseInfo.GetText, 11)End Sub以上为侦听部分.下面列一个XML的例文?xml version="1.0" encoding="gb2312"?

GRAMMAR LANGID="804"

RULE NAME="命令" TOPLEVEL="ACTIVE"

L

P打开播放器

P上我的QQ

P关闭你自己 /L

/RULE

/GRAMMAR要让系统正确地侦听到你说的话,前提你必须运行语音识别程序并让其激活到"正在聆听"状态.并且你必须有一个能正常使用的话筒而且保证话筒已经打开.(废话-_-|||)以上就是用VB.NET语音识别的最基本的一些操作.希望对你有帮助.更深入的内容有兴趣的话可以和我一起研究.

vb点虐 文字转语音

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim s As Object

s = CreateObject("sapi.spvoice")

s.speak("speak")

End Sub


网页名称:vb点虐 语音聊天 vb聊天代码
分享地址:http://kswsj.cn/article/ddsesch.html

其他资讯