Form1.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 MSXML2;//引入com microsoft.xml.3.0
  9. namespace WindowsApplication1
  10. {
  11. public partial class Form1 : Form
  12. {
  13. public Form1()
  14. {
  15. InitializeComponent();
  16. }
  17. private void button1_Click_1(object sender, EventArgs e)
  18. {
  19. string uid = t_uid.Text.Trim();
  20. string pwd = t_pwd.Text.Trim();
  21. string mob = t_mob.Text.Trim();
  22. string msg = t_msg.Text.Trim();
  23. string Send_URL = "http://service.winic.org/sys_port/gateway/?id=" + uid + "&pwd=" + pwd + "&to=" + mob + "&content=" + msg + "&time=";
  24. //____________________________
  25. MSXML2.XMLHTTP xmlhttp = new MSXML2.XMLHTTP();
  26. xmlhttp.open("GET", Send_URL, false, null, null);
  27. xmlhttp.send("");
  28. MSXML2.XMLDocument dom = new XMLDocument();
  29. Byte[] b = (Byte[])xmlhttp.responseBody;
  30. //string Flag = System.Text.ASCIIEncoding.UTF8.GetString(b, 0, b.Length);
  31. string andy = System.Text.Encoding.GetEncoding("GB2312").GetString(b).Trim();
  32. vtag.Text = andy;
  33. }
  34. private void button2_Click(object sender, EventArgs e)
  35. {
  36. string uid = t_uid.Text.Trim();
  37. string pwd = t_pwd.Text.Trim();
  38. string Send_URL = "http://service.winic.org:8009/webservice/public/remoney.asp?uid=" + uid + "&pwd=" + pwd + "";
  39. //____________________________
  40. MSXML2.XMLHTTP xmlhttp = new MSXML2.XMLHTTP();
  41. xmlhttp.open("GET", Send_URL, false, null, null);
  42. xmlhttp.send("");
  43. MSXML2.XMLDocument dom = new XMLDocument();
  44. Byte[] b = (Byte[])xmlhttp.responseBody;
  45. //string Flag = System.Text.ASCIIEncoding.UTF8.GetString(b, 0, b.Length);
  46. string andy = System.Text.Encoding.GetEncoding("GB2312").GetString(b).Trim();
  47. vtag.Text = andy;
  48. }
  49. private void button3_Click(object sender, EventArgs e)
  50. {
  51. SoftKey ytSoftKey = new SoftKey();
  52. short ret = ytSoftKey.Ini();
  53. if (ret == -1053) { MessageBox.Show("系统上没有发现有任何加密锁,请插入加密锁后再进行操作。"); return; }
  54. // else MessageBox.Show("正版用户");
  55. // card_gzdy@gdb.com.cn 21组 3480 周小姐
  56. string retMsg = ytSoftKey.GetErrInfo(ret);
  57. if (ret != 0)
  58. {
  59. //m_key.Text是用户输入的授权码,为513个字符串长度,含结束字符串
  60. ret = ytSoftKey.Reg("A8FB611A633FA015754E9D762BD7889C6CCD8C01699AE9D6CF35AA13D6BD0FADF51764A04CA91F03E944595C5DA1591AFD0EA0DA0E82680CD7F4C7D78EAFCFD29315DC0A90E7A1AAD44EE114862A27C3F5B2D08345E920071814D1CED2C86F2BCBCDD268C89C62E1B792EFDDF64C748BD6308385892D7456850F580EE6F4B6F8");//使用我们的开发工具生成的加密类的注册函数对生成的加密文件进行注册
  61. if (ret != 0) { MessageBox.Show("注册错误,错误原因是:" + ytSoftKey.GetErrInfo(ret)); return; }
  62. ret = ytSoftKey.Ini();
  63. if (ret != 0) MessageBox.Show("找不到指定的加密锁,继续运行将会导致运算结果不正确。错误原因:" + ytSoftKey.GetErrInfo(ret));
  64. else MessageBox.Show("注册成功");
  65. }
  66. if (ret == 0)
  67. {
  68. int D0 = 0; int D1 = 0; int D2 = 0; int D3 = 0; int D4 = 0; int D5 = 0; int D6 = 0; int D7 = 0;
  69. double F0 = 0; double F1 = 0; double F2 = 0; double F3 = 0; double F4 = 0; double F5 = 0; double F6 = 0; double F7 = 0;
  70. string S0 = "AAAA"; string S1 = ""; string S2 = ""; string S3 = ""; string S4 = ""; string S5 = ""; string S6 = ""; string S7 = "";
  71. short ret2 = ytSoftKey.GetJMGTest(ref D0, ref D1, ref D2, ref D3, ref D4, ref D5, ref D6, ref D7,
  72. ref F0, ref F1, ref F2, ref F3, ref F4, ref F5, ref F6, ref F7,
  73. ref S0, ref S1, ref S2, ref S3, ref S4, ref S5, ref S6, ref S7);
  74. MessageBox.Show(S0);
  75. }
  76. }
  77. }
  78. }