Esempio n. 1
0
        private void button_Export_Html_Click(object sender, EventArgs e)
        {
            if (richTextBox_Return_Data.Text.ToString().Trim() != "")
            {
                string        Serial_Number = string.Empty;
                System.Random Random_Number = new Random();
                string        Time_Code     = DateTime.Now.ToString().Replace("/", "").Replace(":", "").Replace(" ", "");
                string        Code          = Random_Number.Next(1000, 9999).ToString();

                SaveFileDialog Get_File_Name = new SaveFileDialog();
                Get_File_Name.Filter      = "文本文件(*.xml)|*.xml|所有文件(*.*)|*.*";
                Get_File_Name.FilterIndex = 1;
                Get_File_Name.FileName    = "API_Data_" + Time_Code + Code;
                if (Get_File_Name.ShowDialog() == DialogResult.OK)
                {
                    StreamWriter sw = new StreamWriter(Get_File_Name.FileName, true);
                    //向创建的文件中写入内容
                    sw.Write(richTextBox_Return_Data.Text.ToString());
                    //关闭当前文件写入流
                    sw.Close();
                    Base_Deal_Class.Message_Alert(label_Message_Print, "导出成功!");
                }
            }
            else
            {
                Base_Deal_Class.Message_Alert(label_Message_Print, "导出失败,当前返回数据为空!");
            }
        }
Esempio n. 2
0
        private void button_Submit_Click(object sender, EventArgs e)
        {
            if (textBox_URL.Text == "")
            {
                label_Message_Print.Text = "";
                Base_Deal_Class.Message_Alert(label_Message_Print, "请输入您的URL请求地址!");
            }
            else
            {
                label_Message_Print.Text = "";
                string Request_URL  = textBox_URL.Text.Trim();
                string Request_Data = richTextBox_Submit_Data.Text;
                string Request_Type = comboBox_Submit_Type.Text.Trim();

                try
                {
                    richTextBox_Return_Data.Text = Request_Deal_Class.All_Deal_Request(Request_URL, Request_Type, Request_Data);
                    Base_Deal_Class.Message_Alert(label_Message_Print, "请求成功!");
                }
                catch (Exception ex_string)
                {
                    label_Message_Print.Text = ex_string.ToString();
                }
            }
        }
Esempio n. 3
0
 private void button_Transform_Click(object sender, EventArgs e)
 {
     textBox_URL.Text = textBox_URL.Text.Replace("api.", "sl.api.").Replace("token", textBox_token.Text.Trim());
     Base_Deal_Class.Message_Alert(label_Message_Print, "转换成功!");
 }