Exemplo n.º 1
0
        private void 笑话ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string str = TulingApi.GetResponse("讲个笑话");

            反应Label.Text = "";
            int length = str.Length;
            int num    = 0;
            int rownum = length / 20;

            for (int i = 0; i <= rownum; i++)
            {
                if (num >= length)
                {
                    break;
                }
                for (int j = 0; j < 20; j++)
                {
                    if (num >= length - 1)
                    {
                        break;
                    }
                    反应Label.Text += str[i * 20 + j];
                    num++;
                }
                反应Label.Text += "\n";
            }
        }
Exemplo n.º 2
0
        private void 天气ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string str = TulingApi.GetResponse("株洲天气");

            反应Label.Text = str;
        }