好吧,我编辑了我的代码,我没有收到错误,但 messageBox.Show 没有返回任何空框。
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 System.Globalization; using System.IO; using System.Net; using System.Web; using System.Web.Script.Serialization; namespace WindowsFormsApplication2 { public partial class Form1 : Form { private JavaScriptSerializer _Serializer = new JavaScriptSerializer(); public Form1() { InitializeComponent(); string f = TranslateText("hi", "English", "German", "", ""); MessageBox.Show(f); } private void Form1_Load(object sender, EventArgs e) { } public string TranslateText(string inputText, string sourceLanguage, string destinationLanguage, string referrer, string apiKey) { string requestUrl = string....