码迷,mamicode.com
首页 > Windows程序 > 详细

public static void speckOnWin7(string text),在win7中读文字

时间:2016-08-20 17:38:20      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

public static void speckOnWin7(string text)
{    //洪丰写的,转载请注明
try
{
string lsSource = "";
//if (File.Exists(Application.StartupPath + "\\Error.txt"))
// lsSource = File.ReadAllText(Application.StartupPath + "\\Error.txt");
//string lsT = "\r\n\r\n*************************************************************\r\n" + DateTime.Now.ToString() + "\r\n" + CommInfo.UserId + "\r\n" + CommInfo.UserName + "\r\n*************************************************************\r\n";

string ls_vbs_string=@"CreateObject(""SAPI.SpVoice"").Speak """+text+@"""";
File.WriteAllText(Application.StartupPath + "\\as_speck" + ".vbs", ls_vbs_string, Encoding.GetEncoding("GBK")); //+ DateTime.Now.ToString()
System.Diagnostics.Process.Start(Application.StartupPath + "\\as_speck.vbs");

 

}
catch (Exception ei)
{
return;
}
}

public static void speckOnWin7(string text),在win7中读文字

标签:

原文地址:http://www.cnblogs.com/HaiHong/p/5790651.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!