Form1.cs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using System.IO;
  8. namespace WindowsApplication1
  9. {
  10. /// <summary>
  11. /// Form1 的摘要说明。
  12. /// </summary>
  13. public class Form1 : System.Windows.Forms.Form
  14. {
  15. private System.Windows.Forms.OpenFileDialog openFileDialog1;
  16. private GroupBox groupBox3;
  17. private Button button1;
  18. private Label label5;
  19. private Label label4;
  20. private TextBox pwd;
  21. private TextBox uid;
  22. private RichTextBox btxt;
  23. private Label label6;
  24. private RichTextBox richTextBox1;
  25. private Label label11;
  26. private GroupBox mode3;
  27. private RadioButton mode2;
  28. private RadioButton mode4;
  29. private RadioButton mode5;
  30. private Label label14;
  31. private RichTextBox fvtxt;
  32. private Label label13;
  33. private Label label15;
  34. private RichTextBox fvto;
  35. private Label label16;
  36. private Button btf;
  37. private TextBox fvfile;
  38. private Button button5;
  39. private GroupBox groupBox2;
  40. private Button button4;
  41. private Label label7;
  42. private Label label3;
  43. private RichTextBox smstxt;
  44. private RichTextBox smsmob;
  45. private GroupBox groupBox1;
  46. private Label label10;
  47. private Label label1;
  48. private Label label9;
  49. private TextBox title;
  50. private TextBox men;
  51. private Label label8;
  52. private RichTextBox faxno;
  53. private Label label2;
  54. private Button button3;
  55. private TextBox filepath;
  56. private Button button6;
  57. private TextBox mode;
  58. private Label label12;
  59. private TextBox v_svrno;
  60. /// <summary>
  61. /// 必需的设计器变量。
  62. /// </summary>
  63. private System.ComponentModel.Container components = null;
  64. public Form1()
  65. {
  66. //
  67. // Windows 窗体设计器支持所必需的
  68. //
  69. InitializeComponent();
  70. //
  71. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  72. //
  73. }
  74. /// <summary>
  75. /// 清理所有正在使用的资源。
  76. /// </summary>
  77. protected override void Dispose( bool disposing )
  78. {
  79. if( disposing )
  80. {
  81. if (components != null)
  82. {
  83. components.Dispose();
  84. }
  85. }
  86. base.Dispose( disposing );
  87. }
  88. #region Windows 窗体设计器生成的代码
  89. /// <summary>
  90. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  91. /// 此方法的内容。
  92. /// </summary>
  93. private void InitializeComponent()
  94. {
  95. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
  96. this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
  97. this.groupBox3 = new System.Windows.Forms.GroupBox();
  98. this.button1 = new System.Windows.Forms.Button();
  99. this.label5 = new System.Windows.Forms.Label();
  100. this.label4 = new System.Windows.Forms.Label();
  101. this.pwd = new System.Windows.Forms.TextBox();
  102. this.uid = new System.Windows.Forms.TextBox();
  103. this.btxt = new System.Windows.Forms.RichTextBox();
  104. this.label6 = new System.Windows.Forms.Label();
  105. this.richTextBox1 = new System.Windows.Forms.RichTextBox();
  106. this.label11 = new System.Windows.Forms.Label();
  107. this.mode3 = new System.Windows.Forms.GroupBox();
  108. this.mode = new System.Windows.Forms.TextBox();
  109. this.mode2 = new System.Windows.Forms.RadioButton();
  110. this.mode4 = new System.Windows.Forms.RadioButton();
  111. this.mode5 = new System.Windows.Forms.RadioButton();
  112. this.label14 = new System.Windows.Forms.Label();
  113. this.fvtxt = new System.Windows.Forms.RichTextBox();
  114. this.label13 = new System.Windows.Forms.Label();
  115. this.label15 = new System.Windows.Forms.Label();
  116. this.fvto = new System.Windows.Forms.RichTextBox();
  117. this.label16 = new System.Windows.Forms.Label();
  118. this.btf = new System.Windows.Forms.Button();
  119. this.fvfile = new System.Windows.Forms.TextBox();
  120. this.button5 = new System.Windows.Forms.Button();
  121. this.groupBox2 = new System.Windows.Forms.GroupBox();
  122. this.button4 = new System.Windows.Forms.Button();
  123. this.label7 = new System.Windows.Forms.Label();
  124. this.label3 = new System.Windows.Forms.Label();
  125. this.smstxt = new System.Windows.Forms.RichTextBox();
  126. this.smsmob = new System.Windows.Forms.RichTextBox();
  127. this.groupBox1 = new System.Windows.Forms.GroupBox();
  128. this.button6 = new System.Windows.Forms.Button();
  129. this.label10 = new System.Windows.Forms.Label();
  130. this.label1 = new System.Windows.Forms.Label();
  131. this.label9 = new System.Windows.Forms.Label();
  132. this.title = new System.Windows.Forms.TextBox();
  133. this.men = new System.Windows.Forms.TextBox();
  134. this.label8 = new System.Windows.Forms.Label();
  135. this.faxno = new System.Windows.Forms.RichTextBox();
  136. this.label2 = new System.Windows.Forms.Label();
  137. this.button3 = new System.Windows.Forms.Button();
  138. this.filepath = new System.Windows.Forms.TextBox();
  139. this.v_svrno = new System.Windows.Forms.TextBox();
  140. this.label12 = new System.Windows.Forms.Label();
  141. this.groupBox3.SuspendLayout();
  142. this.mode3.SuspendLayout();
  143. this.groupBox2.SuspendLayout();
  144. this.groupBox1.SuspendLayout();
  145. this.SuspendLayout();
  146. //
  147. // groupBox3
  148. //
  149. this.groupBox3.BackColor = System.Drawing.SystemColors.Control;
  150. this.groupBox3.Controls.Add(this.button1);
  151. this.groupBox3.Controls.Add(this.label5);
  152. this.groupBox3.Controls.Add(this.label4);
  153. this.groupBox3.Controls.Add(this.pwd);
  154. this.groupBox3.Controls.Add(this.uid);
  155. this.groupBox3.Location = new System.Drawing.Point(13, 9);
  156. this.groupBox3.Name = "groupBox3";
  157. this.groupBox3.Size = new System.Drawing.Size(348, 55);
  158. this.groupBox3.TabIndex = 7;
  159. this.groupBox3.TabStop = false;
  160. this.groupBox3.Text = "账户信息";
  161. //
  162. // button1
  163. //
  164. this.button1.Location = new System.Drawing.Point(263, 17);
  165. this.button1.Name = "button1";
  166. this.button1.Size = new System.Drawing.Size(69, 23);
  167. this.button1.TabIndex = 5;
  168. this.button1.Text = "查询账户";
  169. this.button1.UseVisualStyleBackColor = true;
  170. this.button1.Click += new System.EventHandler(this.button1_Click);
  171. //
  172. // label5
  173. //
  174. this.label5.Location = new System.Drawing.Point(135, 22);
  175. this.label5.Name = "label5";
  176. this.label5.Size = new System.Drawing.Size(29, 14);
  177. this.label5.TabIndex = 4;
  178. this.label5.Text = "密码";
  179. //
  180. // label4
  181. //
  182. this.label4.Location = new System.Drawing.Point(6, 22);
  183. this.label4.Name = "label4";
  184. this.label4.Size = new System.Drawing.Size(31, 16);
  185. this.label4.TabIndex = 3;
  186. this.label4.Text = "账号";
  187. //
  188. // pwd
  189. //
  190. this.pwd.Location = new System.Drawing.Point(170, 17);
  191. this.pwd.Name = "pwd";
  192. this.pwd.Size = new System.Drawing.Size(87, 21);
  193. this.pwd.TabIndex = 2;
  194. this.pwd.Text = "123456";
  195. //
  196. // uid
  197. //
  198. this.uid.Location = new System.Drawing.Point(43, 17);
  199. this.uid.Name = "uid";
  200. this.uid.Size = new System.Drawing.Size(86, 21);
  201. this.uid.TabIndex = 1;
  202. this.uid.Text = "test";
  203. //
  204. // btxt
  205. //
  206. this.btxt.Location = new System.Drawing.Point(12, 115);
  207. this.btxt.Name = "btxt";
  208. this.btxt.Size = new System.Drawing.Size(348, 69);
  209. this.btxt.TabIndex = 8;
  210. this.btxt.Text = "";
  211. //
  212. // label6
  213. //
  214. this.label6.AutoSize = true;
  215. this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  216. this.label6.ForeColor = System.Drawing.SystemColors.ActiveCaption;
  217. this.label6.Location = new System.Drawing.Point(9, 78);
  218. this.label6.Name = "label6";
  219. this.label6.Size = new System.Drawing.Size(344, 16);
  220. this.label6.TabIndex = 9;
  221. this.label6.Text = "执行后返回状态(请对昭下面的返回参数说明表)";
  222. //
  223. // richTextBox1
  224. //
  225. this.richTextBox1.BackColor = System.Drawing.SystemColors.ControlLight;
  226. this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
  227. this.richTextBox1.Location = new System.Drawing.Point(12, 220);
  228. this.richTextBox1.Name = "richTextBox1";
  229. this.richTextBox1.Size = new System.Drawing.Size(348, 370);
  230. this.richTextBox1.TabIndex = 10;
  231. this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
  232. //
  233. // label11
  234. //
  235. this.label11.AutoSize = true;
  236. this.label11.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  237. this.label11.ForeColor = System.Drawing.SystemColors.ActiveCaption;
  238. this.label11.Location = new System.Drawing.Point(9, 188);
  239. this.label11.Name = "label11";
  240. this.label11.Size = new System.Drawing.Size(123, 19);
  241. this.label11.TabIndex = 11;
  242. this.label11.Text = "返参数说明表";
  243. //
  244. // mode3
  245. //
  246. this.mode3.BackColor = System.Drawing.SystemColors.Control;
  247. this.mode3.Controls.Add(this.label12);
  248. this.mode3.Controls.Add(this.v_svrno);
  249. this.mode3.Controls.Add(this.mode);
  250. this.mode3.Controls.Add(this.mode2);
  251. this.mode3.Controls.Add(this.mode4);
  252. this.mode3.Controls.Add(this.mode5);
  253. this.mode3.Controls.Add(this.label14);
  254. this.mode3.Controls.Add(this.fvtxt);
  255. this.mode3.Controls.Add(this.label13);
  256. this.mode3.Controls.Add(this.label15);
  257. this.mode3.Controls.Add(this.fvto);
  258. this.mode3.Controls.Add(this.label16);
  259. this.mode3.Controls.Add(this.btf);
  260. this.mode3.Controls.Add(this.fvfile);
  261. this.mode3.Controls.Add(this.button5);
  262. this.mode3.Location = new System.Drawing.Point(382, 369);
  263. this.mode3.Name = "mode3";
  264. this.mode3.Size = new System.Drawing.Size(470, 221);
  265. this.mode3.TabIndex = 15;
  266. this.mode3.TabStop = false;
  267. this.mode3.Text = "语音引擎";
  268. //
  269. // mode
  270. //
  271. this.mode.Location = new System.Drawing.Point(433, 17);
  272. this.mode.Name = "mode";
  273. this.mode.ReadOnly = true;
  274. this.mode.Size = new System.Drawing.Size(20, 21);
  275. this.mode.TabIndex = 22;
  276. this.mode.Text = "1";
  277. //
  278. // mode2
  279. //
  280. this.mode2.AutoSize = true;
  281. this.mode2.Location = new System.Drawing.Point(278, 21);
  282. this.mode2.Name = "mode2";
  283. this.mode2.Size = new System.Drawing.Size(71, 16);
  284. this.mode2.TabIndex = 21;
  285. this.mode2.Text = "软件合成";
  286. this.mode2.UseVisualStyleBackColor = true;
  287. this.mode2.CheckedChanged += new System.EventHandler(this.mode2_CheckedChanged);
  288. //
  289. // mode4
  290. //
  291. this.mode4.AutoSize = true;
  292. this.mode4.Location = new System.Drawing.Point(356, 21);
  293. this.mode4.Name = "mode4";
  294. this.mode4.Size = new System.Drawing.Size(71, 16);
  295. this.mode4.TabIndex = 20;
  296. this.mode4.Text = "录音文件";
  297. this.mode4.UseVisualStyleBackColor = true;
  298. this.mode4.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged_1);
  299. //
  300. // mode5
  301. //
  302. this.mode5.AutoSize = true;
  303. this.mode5.Checked = true;
  304. this.mode5.Location = new System.Drawing.Point(200, 20);
  305. this.mode5.Name = "mode5";
  306. this.mode5.Size = new System.Drawing.Size(71, 16);
  307. this.mode5.TabIndex = 19;
  308. this.mode5.TabStop = true;
  309. this.mode5.Text = "人工合成";
  310. this.mode5.UseVisualStyleBackColor = true;
  311. this.mode5.CheckedChanged += new System.EventHandler(this.mode5_CheckedChanged);
  312. //
  313. // label14
  314. //
  315. this.label14.AutoSize = true;
  316. this.label14.Location = new System.Drawing.Point(165, 21);
  317. this.label14.Name = "label14";
  318. this.label14.Size = new System.Drawing.Size(29, 12);
  319. this.label14.TabIndex = 18;
  320. this.label14.Text = "类型";
  321. //
  322. // fvtxt
  323. //
  324. this.fvtxt.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  325. this.fvtxt.ForeColor = System.Drawing.SystemColors.HotTrack;
  326. this.fvtxt.Location = new System.Drawing.Point(166, 65);
  327. this.fvtxt.Name = "fvtxt";
  328. this.fvtxt.Size = new System.Drawing.Size(291, 72);
  329. this.fvtxt.TabIndex = 17;
  330. this.fvtxt.Text = "移动商务应用中心,为您提供统一通信服务。系统测试中请稍侯!";
  331. //
  332. // label13
  333. //
  334. this.label13.AutoSize = true;
  335. this.label13.Location = new System.Drawing.Point(161, 148);
  336. this.label13.Name = "label13";
  337. this.label13.Size = new System.Drawing.Size(53, 12);
  338. this.label13.TabIndex = 15;
  339. this.label13.Text = "录音文件";
  340. //
  341. // label15
  342. //
  343. this.label15.AutoSize = true;
  344. this.label15.Location = new System.Drawing.Point(165, 50);
  345. this.label15.Name = "label15";
  346. this.label15.Size = new System.Drawing.Size(113, 12);
  347. this.label15.TabIndex = 11;
  348. this.label15.Text = "语音文字(8000个字)";
  349. //
  350. // fvto
  351. //
  352. this.fvto.BackColor = System.Drawing.SystemColors.Info;
  353. this.fvto.Location = new System.Drawing.Point(6, 38);
  354. this.fvto.Name = "fvto";
  355. this.fvto.Size = new System.Drawing.Size(153, 110);
  356. this.fvto.TabIndex = 10;
  357. this.fvto.Text = "";
  358. //
  359. // label16
  360. //
  361. this.label16.AutoSize = true;
  362. this.label16.Location = new System.Drawing.Point(6, 17);
  363. this.label16.Name = "label16";
  364. this.label16.Size = new System.Drawing.Size(137, 12);
  365. this.label16.TabIndex = 7;
  366. this.label16.Text = "接收号码(多个逗号隔开)";
  367. //
  368. // btf
  369. //
  370. this.btf.Enabled = false;
  371. this.btf.Location = new System.Drawing.Point(409, 143);
  372. this.btf.Name = "btf";
  373. this.btf.Size = new System.Drawing.Size(48, 23);
  374. this.btf.TabIndex = 6;
  375. this.btf.Text = "*.WAV";
  376. this.btf.Click += new System.EventHandler(this.button2_Click_1);
  377. //
  378. // fvfile
  379. //
  380. this.fvfile.Enabled = false;
  381. this.fvfile.Location = new System.Drawing.Point(220, 145);
  382. this.fvfile.Name = "fvfile";
  383. this.fvfile.Size = new System.Drawing.Size(184, 21);
  384. this.fvfile.TabIndex = 3;
  385. //
  386. // button5
  387. //
  388. this.button5.Location = new System.Drawing.Point(242, 172);
  389. this.button5.Name = "button5";
  390. this.button5.Size = new System.Drawing.Size(128, 37);
  391. this.button5.TabIndex = 1;
  392. this.button5.Text = "发送语音";
  393. this.button5.Click += new System.EventHandler(this.button5_Click);
  394. //
  395. // groupBox2
  396. //
  397. this.groupBox2.BackColor = System.Drawing.SystemColors.Control;
  398. this.groupBox2.Controls.Add(this.button4);
  399. this.groupBox2.Controls.Add(this.label7);
  400. this.groupBox2.Controls.Add(this.label3);
  401. this.groupBox2.Controls.Add(this.smstxt);
  402. this.groupBox2.Controls.Add(this.smsmob);
  403. this.groupBox2.Location = new System.Drawing.Point(382, 2);
  404. this.groupBox2.Name = "groupBox2";
  405. this.groupBox2.Size = new System.Drawing.Size(470, 157);
  406. this.groupBox2.TabIndex = 14;
  407. this.groupBox2.TabStop = false;
  408. this.groupBox2.Text = "发短信";
  409. //
  410. // button4
  411. //
  412. this.button4.Location = new System.Drawing.Point(242, 113);
  413. this.button4.Name = "button4";
  414. this.button4.Size = new System.Drawing.Size(152, 40);
  415. this.button4.TabIndex = 13;
  416. this.button4.Text = "发送短信";
  417. this.button4.UseVisualStyleBackColor = true;
  418. this.button4.Click += new System.EventHandler(this.button4_Click_1);
  419. //
  420. // label7
  421. //
  422. this.label7.Location = new System.Drawing.Point(206, 17);
  423. this.label7.Name = "label7";
  424. this.label7.Size = new System.Drawing.Size(188, 14);
  425. this.label7.TabIndex = 12;
  426. this.label7.Text = "短信内容(60-70字超过做下循环)";
  427. //
  428. // label3
  429. //
  430. this.label3.Location = new System.Drawing.Point(6, 17);
  431. this.label3.Name = "label3";
  432. this.label3.Size = new System.Drawing.Size(144, 14);
  433. this.label3.TabIndex = 11;
  434. this.label3.Text = "手机号(多个用,号分隔)";
  435. //
  436. // smstxt
  437. //
  438. this.smstxt.BackColor = System.Drawing.SystemColors.ButtonHighlight;
  439. this.smstxt.ForeColor = System.Drawing.SystemColors.HotTrack;
  440. this.smstxt.Location = new System.Drawing.Point(177, 34);
  441. this.smstxt.Name = "smstxt";
  442. this.smstxt.Size = new System.Drawing.Size(282, 73);
  443. this.smstxt.TabIndex = 10;
  444. this.smstxt.Text = "您好!工作愉快!";
  445. //
  446. // smsmob
  447. //
  448. this.smsmob.BackColor = System.Drawing.SystemColors.Info;
  449. this.smsmob.Location = new System.Drawing.Point(8, 34);
  450. this.smsmob.Name = "smsmob";
  451. this.smsmob.Size = new System.Drawing.Size(163, 113);
  452. this.smsmob.TabIndex = 9;
  453. this.smsmob.Text = "";
  454. //
  455. // groupBox1
  456. //
  457. this.groupBox1.BackColor = System.Drawing.SystemColors.Control;
  458. this.groupBox1.Controls.Add(this.button6);
  459. this.groupBox1.Controls.Add(this.label10);
  460. this.groupBox1.Controls.Add(this.label1);
  461. this.groupBox1.Controls.Add(this.label9);
  462. this.groupBox1.Controls.Add(this.title);
  463. this.groupBox1.Controls.Add(this.men);
  464. this.groupBox1.Controls.Add(this.label8);
  465. this.groupBox1.Controls.Add(this.faxno);
  466. this.groupBox1.Controls.Add(this.label2);
  467. this.groupBox1.Controls.Add(this.button3);
  468. this.groupBox1.Controls.Add(this.filepath);
  469. this.groupBox1.Location = new System.Drawing.Point(382, 165);
  470. this.groupBox1.Name = "groupBox1";
  471. this.groupBox1.Size = new System.Drawing.Size(470, 185);
  472. this.groupBox1.TabIndex = 13;
  473. this.groupBox1.TabStop = false;
  474. this.groupBox1.Text = "发传真";
  475. //
  476. // button6
  477. //
  478. this.button6.Location = new System.Drawing.Point(200, 146);
  479. this.button6.Name = "button6";
  480. this.button6.Size = new System.Drawing.Size(109, 33);
  481. this.button6.TabIndex = 17;
  482. this.button6.Text = "发送传真";
  483. this.button6.UseVisualStyleBackColor = true;
  484. this.button6.Click += new System.EventHandler(this.button6_Click);
  485. //
  486. // label10
  487. //
  488. this.label10.AutoSize = true;
  489. this.label10.Location = new System.Drawing.Point(15, 89);
  490. this.label10.Name = "label10";
  491. this.label10.Size = new System.Drawing.Size(53, 12);
  492. this.label10.TabIndex = 16;
  493. this.label10.Text = "逗号隔开";
  494. //
  495. // label1
  496. //
  497. this.label1.AutoSize = true;
  498. this.label1.Location = new System.Drawing.Point(15, 122);
  499. this.label1.Name = "label1";
  500. this.label1.Size = new System.Drawing.Size(53, 12);
  501. this.label1.TabIndex = 15;
  502. this.label1.Text = "传真文档";
  503. //
  504. // label9
  505. //
  506. this.label9.AutoSize = true;
  507. this.label9.Location = new System.Drawing.Point(179, 23);
  508. this.label9.Name = "label9";
  509. this.label9.Size = new System.Drawing.Size(53, 12);
  510. this.label9.TabIndex = 14;
  511. this.label9.Text = "文档名称";
  512. //
  513. // title
  514. //
  515. this.title.Location = new System.Drawing.Point(249, 20);
  516. this.title.Name = "title";
  517. this.title.Size = new System.Drawing.Size(100, 21);
  518. this.title.TabIndex = 13;
  519. this.title.Text = "报价表";
  520. //
  521. // men
  522. //
  523. this.men.Location = new System.Drawing.Point(59, 20);
  524. this.men.Name = "men";
  525. this.men.Size = new System.Drawing.Size(100, 21);
  526. this.men.TabIndex = 12;
  527. this.men.Text = "张三";
  528. //
  529. // label8
  530. //
  531. this.label8.AutoSize = true;
  532. this.label8.Location = new System.Drawing.Point(12, 23);
  533. this.label8.Name = "label8";
  534. this.label8.Size = new System.Drawing.Size(41, 12);
  535. this.label8.TabIndex = 11;
  536. this.label8.Text = "收件人";
  537. //
  538. // faxno
  539. //
  540. this.faxno.BackColor = System.Drawing.SystemColors.Info;
  541. this.faxno.Location = new System.Drawing.Point(77, 47);
  542. this.faxno.Name = "faxno";
  543. this.faxno.Size = new System.Drawing.Size(382, 66);
  544. this.faxno.TabIndex = 10;
  545. this.faxno.Text = "";
  546. //
  547. // label2
  548. //
  549. this.label2.AutoSize = true;
  550. this.label2.Location = new System.Drawing.Point(15, 64);
  551. this.label2.Name = "label2";
  552. this.label2.Size = new System.Drawing.Size(53, 12);
  553. this.label2.TabIndex = 7;
  554. this.label2.Text = "接收号码";
  555. //
  556. // button3
  557. //
  558. this.button3.Location = new System.Drawing.Point(387, 117);
  559. this.button3.Name = "button3";
  560. this.button3.Size = new System.Drawing.Size(40, 23);
  561. this.button3.TabIndex = 6;
  562. this.button3.Text = "浏览文件";
  563. this.button3.Click += new System.EventHandler(this.button3_Click_1);
  564. //
  565. // filepath
  566. //
  567. this.filepath.Location = new System.Drawing.Point(77, 119);
  568. this.filepath.Name = "filepath";
  569. this.filepath.Size = new System.Drawing.Size(304, 21);
  570. this.filepath.TabIndex = 3;
  571. //
  572. // v_svrno
  573. //
  574. this.v_svrno.Location = new System.Drawing.Point(6, 181);
  575. this.v_svrno.Name = "v_svrno";
  576. this.v_svrno.Size = new System.Drawing.Size(151, 21);
  577. this.v_svrno.TabIndex = 23;
  578. this.v_svrno.Text = "075525599861";
  579. //
  580. // label12
  581. //
  582. this.label12.AutoSize = true;
  583. this.label12.Location = new System.Drawing.Point(6, 154);
  584. this.label12.Name = "label12";
  585. this.label12.Size = new System.Drawing.Size(137, 12);
  586. this.label12.TabIndex = 24;
  587. this.label12.Text = "客服号码(多个逗号隔开)";
  588. //
  589. // Form1
  590. //
  591. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  592. this.ClientSize = new System.Drawing.Size(875, 608);
  593. this.Controls.Add(this.mode3);
  594. this.Controls.Add(this.groupBox2);
  595. this.Controls.Add(this.groupBox1);
  596. this.Controls.Add(this.label11);
  597. this.Controls.Add(this.richTextBox1);
  598. this.Controls.Add(this.label6);
  599. this.Controls.Add(this.groupBox3);
  600. this.Controls.Add(this.btxt);
  601. this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  602. this.Name = "Form1";
  603. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  604. this.Text = "c#调用webservice Demo";
  605. this.groupBox3.ResumeLayout(false);
  606. this.groupBox3.PerformLayout();
  607. this.mode3.ResumeLayout(false);
  608. this.mode3.PerformLayout();
  609. this.groupBox2.ResumeLayout(false);
  610. this.groupBox1.ResumeLayout(false);
  611. this.groupBox1.PerformLayout();
  612. this.ResumeLayout(false);
  613. this.PerformLayout();
  614. }
  615. #endregion
  616. /// <summary>
  617. /// 应用程序的主入口点。
  618. /// </summary>
  619. [STAThread]
  620. static void Main()
  621. {
  622. Application.Run(new Form1());
  623. }
  624. private void button2_Click(object sender, System.EventArgs e)
  625. {
  626. if (filepath.Text=="")
  627. {
  628. MessageBox.Show("传真文件不能为空");
  629. return;
  630. }
  631. string filename = filepath.Text.Substring(filepath.Text.LastIndexOf("\\")).Replace("\\", ""); //根据全路径取文件名
  632. // MessageBox.Show(filename);
  633. Service1.Service1 xx = new Service1.Service1() ;
  634. FileStream fs = new FileStream(filepath.Text, FileMode.Open); //Client Side Path
  635. byte[] buffer = new byte[fs.Length];
  636. fs.Read(buffer, 0, buffer.Length);
  637. try
  638. {
  639. btxt.Text = xx.SendFax(uid.Text, pwd.Text, faxno.Text, men.Text, title.Text, buffer, filename);
  640. }
  641. catch
  642. {
  643. MessageBox.Show("出错");
  644. }
  645. finally
  646. {
  647. fs.Close();
  648. }
  649. }
  650. private void label2_Click(object sender, System.EventArgs e)
  651. {
  652. }
  653. private void textBox2_TextChanged(object sender, System.EventArgs e)
  654. {
  655. }
  656. private void button3_Click(object sender, System.EventArgs e)
  657. {
  658. openFileDialog1.Multiselect = true;
  659. openFileDialog1.ShowDialog();
  660. //if (openFileDialog1.ShowDialog())
  661. if (openFileDialog1.FileName != "")
  662. {
  663. filepath.Text = openFileDialog1.FileName;
  664. // filename.Text = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\")).Replace("\\", "");//取用户名和后缀
  665. }
  666. }
  667. private void button1_Click(object sender, EventArgs e)
  668. {
  669. Service1.Service1 getid = new Service1.Service1();
  670. btxt.Text=getid.GetUserInfo(uid.Text,pwd.Text);
  671. }
  672. private void button4_Click_1(object sender, EventArgs e)
  673. {
  674. Service1.Service1 sendmsg = new Service1.Service1();
  675. btxt.Text = sendmsg.SendMessages(uid.Text, pwd.Text, smsmob.Text, smstxt.Text, "");
  676. }
  677. private void 发送传真_Click(object sender, EventArgs e)
  678. {
  679. if (filepath.Text == "")
  680. {
  681. MessageBox.Show("传真文件不能为空");
  682. return;
  683. }
  684. string filename = filepath.Text.Substring(filepath.Text.LastIndexOf("\\")).Replace("\\", ""); //根据全路径取文件名
  685. // MessageBox.Show(filename);
  686. Service1.Service1 xx = new Service1.Service1();
  687. FileStream fs = new FileStream(filepath.Text, FileMode.Open); //Client Side Path
  688. byte[] buffer = new byte[fs.Length];
  689. fs.Read(buffer, 0, buffer.Length);
  690. try
  691. {
  692. btxt.Text = xx.SendFax(uid.Text, pwd.Text, faxno.Text, men.Text, title.Text, buffer, filename);
  693. }
  694. catch
  695. {
  696. MessageBox.Show("出错");
  697. }
  698. finally
  699. {
  700. fs.Close();
  701. }
  702. }
  703. private void button3_Click_1(object sender, EventArgs e)
  704. {
  705. openFileDialog1.Multiselect = true;
  706. openFileDialog1.ShowDialog();
  707. //if (openFileDialog1.ShowDialog())
  708. if (openFileDialog1.FileName != "")
  709. {
  710. filepath.Text = openFileDialog1.FileName;
  711. // filename.Text = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\")).Replace("\\", "");//取用户名和后缀
  712. }
  713. }
  714. private void radioButton2_CheckedChanged_1(object sender, EventArgs e)
  715. {
  716. if (mode4.Checked)
  717. {
  718. fvfile.Enabled = true;
  719. btf.Enabled = true;
  720. fvtxt.Enabled = false;
  721. mode.Text = "3";
  722. }
  723. else
  724. {
  725. fvfile.Enabled = false;
  726. btf.Enabled = false;
  727. fvtxt.Enabled = true;
  728. }
  729. }
  730. private void button6_Click(object sender, EventArgs e)
  731. {
  732. byte[] buffer = new byte[0];
  733. if (filepath.Text == "")
  734. {
  735. MessageBox.Show("传真文件不能为空");
  736. return;
  737. }
  738. else
  739. {
  740. FileStream fs = new FileStream(filepath.Text, FileMode.Open); //Client Side Path
  741. buffer = new byte[fs.Length];
  742. fs.Read(buffer, 0, buffer.Length);
  743. fs.Close();
  744. }
  745. string filename = filepath.Text.Substring(filepath.Text.LastIndexOf("\\")).Replace("\\", ""); //根据全路径取文件名
  746. // MessageBox.Show(filename);
  747. Service1.Service1 xx = new Service1.Service1();
  748. try
  749. {
  750. btxt.Text = xx.SendFax(uid.Text, pwd.Text, faxno.Text, men.Text, title.Text, buffer, filename);
  751. }
  752. catch
  753. {
  754. MessageBox.Show("出错");
  755. }
  756. finally
  757. {
  758. // fs.Close();
  759. }
  760. }
  761. private void button5_Click(object sender, EventArgs e)
  762. {
  763. try
  764. {
  765. byte[] buffer;
  766. if (mode4.Checked)
  767. {
  768. if (fvfile.Text == "")
  769. {
  770. MessageBox.Show("请选择语音文件。格式为.WAV 大小不要超过 5M");
  771. return;
  772. }
  773. FileStream fs = new FileStream(fvfile.Text, FileMode.Open); //Client Side Path
  774. buffer = new byte[fs.Length];
  775. fs.Read(buffer, 0, buffer.Length);
  776. fs.Close();
  777. }
  778. else
  779. {
  780. buffer = new byte [0];
  781. }
  782. // MessageBox.Show(filename);
  783. Service1.Service1 vx = new Service1.Service1();
  784. btxt.Text = vx.SendVoice(uid.Text, pwd.Text, fvto.Text, fvtxt.Text,mode.Text, buffer,v_svrno.Text,"", "");
  785. }
  786. catch
  787. {
  788. MessageBox.Show("出错3");
  789. }
  790. finally
  791. {
  792. // fs.Close();
  793. }
  794. }
  795. private void mode5_CheckedChanged(object sender, EventArgs e)
  796. {
  797. if (mode5.Checked)
  798. {
  799. mode.Text = "1";
  800. }
  801. }
  802. private void mode2_CheckedChanged(object sender, EventArgs e)
  803. {
  804. if (mode2.Checked)
  805. {
  806. mode.Text = "2";
  807. }
  808. }
  809. private void button2_Click_1(object sender, EventArgs e)
  810. {
  811. openFileDialog1.Filter = "语音文件|*.WAV|所有文件|*.*";
  812. openFileDialog1.Multiselect = true;
  813. openFileDialog1.ShowDialog();
  814. //if (openFileDialog1.ShowDialog())
  815. if (openFileDialog1.FileName != "")
  816. {
  817. fvfile.Text = openFileDialog1.FileName;
  818. // filename.Text = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\")).Replace("\\", "");//取用户名和后缀
  819. }
  820. openFileDialog1.Filter = "所有文件|*.*";
  821. }
  822. }
  823. }