FrmConnection.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using Core.Mes.ClientFrameWork;
  9. using System.Configuration;
  10. namespace ConnectionServer
  11. {
  12. public partial class FrmConnection : Form
  13. {
  14. public FrmConnection()
  15. {
  16. InitializeComponent();
  17. string url = ConfigurationManager.AppSettings["RemoteServerUrl"];
  18. ClientCommon._RemotingHelp.InitServerUrlList("ServerCommon", url);
  19. }
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. this.listBox1.Items.Clear();
  23. for (int i = 0; i < 10; i++)
  24. {
  25. string strOut = "";
  26. object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon", "Core.Mes.ServerCommon.UserInfoManager", "GetTestData",
  27. null, out strOut);
  28. if (strOut != "")
  29. {
  30. ShowLog("失败:" + strOut);
  31. }
  32. if (obj != null)
  33. {
  34. ShowLog("成功:" + strOut);
  35. //DateTime dtime = Convert.ToDateTime(obj);
  36. //ShowLog("成功:" + dtime.ToString("yyyy-MM-dd"));
  37. }
  38. }
  39. }
  40. private void ShowLog(string log)
  41. {
  42. this.listBox1.Items.Add(log);
  43. this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1;
  44. }
  45. private void button2_Click(object sender, EventArgs e)
  46. {
  47. string strOut = "";
  48. object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon", "Core.Mes.ServerCommon.UserInfoManager", "GetTestData",
  49. null, out strOut);
  50. if (strOut != "")
  51. {
  52. ShowLog("失败:" + strOut);
  53. }
  54. }
  55. }
  56. }