FormWriteMail.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using CommonRPG.Data;
  2. using CommonRPG.Protocol.Client;
  3. using DDogProtocol.Data;
  4. using DDogProtocol.Protocol.Client;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14. namespace CommonRPG.Client.Win32.Forms
  15. {
  16. public partial class FormWriteMail : Form
  17. {
  18. private readonly RPGClient client;
  19. public FormWriteMail(RPGClient client)
  20. {
  21. InitializeComponent();
  22. this.client = client;
  23. }
  24. private void btn_send_Click(object sender, EventArgs e)
  25. {
  26. DDogClientSendMailRequest req = new DDogClientSendMailRequest();
  27. DDogMailContentData content = new DDogMailContentData();
  28. content.txt_content = textBox_mailContent.Text;
  29. //req.c2s_receiver_uuid = combobox_receiver.Text;
  30. req.c2s_receiver_uuid = "";
  31. req.c2s_title = textbox_mailTitle.Text;
  32. req.c2s_content = content;
  33. this.client.GameClient.Request<DDogClientSendMailResponse>(req, (err, rsp) =>
  34. {
  35. if (rsp.IsSuccess)
  36. {
  37. MessageBox.Show("邮件发送成功 : " + rsp);
  38. }
  39. else
  40. {
  41. MessageBox.Show("邮件发送失败 : " + rsp.s2c_code);
  42. }
  43. });
  44. }
  45. }
  46. }