Form1.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.Threading;
  10. using System.Diagnostics;
  11. namespace ConService
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19. private void button1_Click(object sender, EventArgs e)
  20. {
  21. //Thread th = new Thread(new ThreadStart(QueryData));
  22. //th.IsBackground = true;
  23. //th.Start();
  24. //Application.DoEvents();
  25. QueryData();
  26. //C c = new C();
  27. //try
  28. //{
  29. // int x = c.Recursive(10);
  30. //}
  31. //catch (Exception ex)
  32. //{
  33. //}
  34. }
  35. public void QueryData()
  36. {
  37. //while (true)
  38. //{
  39. string url = "Tcp://127.0.0.1:9999/ServerCommon";
  40. string strOut = "";
  41. ClientCommon._RemotingHelp.InitServerUrlList("ServerCommon", url);
  42. object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon", "Core.Mes.ServerCommon.UserInfoManager", "TestQuery",
  43. null, out strOut);
  44. if (strOut != "")
  45. {
  46. }
  47. //}
  48. }
  49. public class C
  50. {
  51. private Stack<int> path
  52. #if DEBUG
  53. = new Stack<int>();
  54. #else
  55. = null;
  56. #endif
  57. public Stack<int> Path
  58. {
  59. get { return path; }
  60. }
  61. [Conditional("DEBUG")]
  62. private void Push(int x)
  63. {
  64. Path.Push(x);
  65. }
  66. [Conditional("DEBUG")]
  67. private void Pop()
  68. {
  69. Path.Pop();
  70. }
  71. public int Recursive(int n)
  72. {
  73. Push(n);
  74. int result = 1;
  75. if (n > 1)
  76. {
  77. result = n * Recursive(n - 1);
  78. Therad();
  79. }
  80. Pop();
  81. return result;
  82. }
  83. private void Therad()
  84. {
  85. int j = 0;
  86. if (j == 0)
  87. {
  88. Therad();
  89. }
  90. }
  91. }
  92. }
  93. }