【发布时间】:2021-08-11 16:46:19
【问题描述】:
我试过了,没问题。
但文本框无法发送文本。 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());
}
但无法从文本框发送文本到请求 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());
}
请帮助我,非常感谢。
【问题讨论】:
-
您是否遇到错误或类似情况?
-
你在哪里设置 textBox1 的值?它是否设置为您认为的那样?拨打电话时doanDuoi2000是什么?
标签: c# httprequest