我试过了,还可以。
但是textbox不能发送文本。text is null
{
//Thread chiadoanduoi2000 = new Thread(chiadoanduoi200);
//chiadoanduoi2000.Start();
// chiadoanduoi2000.IsBackground = true;
string doanDuoi2000 = textBox1.Text;
HttpRequest http = new HttpRequest();
http.AddHeader("apikey", "xxx");
http.AddParam("input", "soem text here");
http.AddParam("speed", "1.0");
http.AddParam("encode_type", "0");
http.AddParam("speaker_id", "3");
string auido = http.Post("https://api.zalo.ai/v1/tts/synthesize").ToString();
textBox1.Text = auido;
textBox2.Text = auido;
//File.WriteAllText("truyen.txt", outputTexts[i].ToString());
}但无法将文本从textbox发送到请求api
{
//Thread chiadoanduoi2000 = new Thread(chiadoanduoi200);
//chiadoanduoi2000.Start();
// chiadoanduoi2000.IsBackground = true;
string doanDuoi2000 = textBox1.Text;
HttpRequest http = new HttpRequest();
http.AddHeader("apikey", "xxx");
http.AddParam("input", doanDuoi2000);
http.AddParam("speed", "1.0");
http.AddParam("encode_type", "0");
http.AddParam("speaker_id", "3");
string auido = http.Post("https://api.zalo.ai/v1/tts/synthesize").ToString();
textBox1.Text = auido;
textBox2.Text = auido;
//File.WriteAllText("truyen.txt", outputTexts[i].ToString());
}请帮帮我,非常感谢。
发布于 2021-08-11 18:39:39
提供textBox1.Text是一个textbox控件,默认情况下,创建后的文本值将返回string.empty。
确保存在类似以下内容的调用:
textbox1 =新文本框();
这通常是由你来处理的。窗体的设计器文件。
https://stackoverflow.com/questions/68746017
复制相似问题