📄 wstest.cs
字号:
/*
* Author : 方伍
* Date: 2008-2-21
* Blog: http://www.cnblogs.com/binbin1845
* QQ: 32418201
* Email: binbin1845@126.com
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WSTest
{
public partial class WSTest : Form
{
public WSTest()
{
InitializeComponent();
cmbAddress.Items.Add("http://localhost/EWS.UI.Service/EWSService.asmx");
cmbAddress.Items.Add("http://localhost/YEA.COMOD.EWS.Service/EWSService.asmx");
}
private void btnTest_Click(object sender, EventArgs e)
{
try
{
string wsAddress = cmbAddress.Text.Trim();
string wsMethod = txtMethod.Text.Trim();
object[] wsParameter = null;
if (txtParameter.Text.Trim() != "")
{
wsParameter = txtParameter.Text.Trim().Split(',');
}
object result = WebServiceHelper.InvokeWebService(wsAddress, wsMethod, wsParameter);
if (result == null)
{
txtResult.Text = "null";
dgResult.DataSource = null;
return;
}
if (result.GetType().FullName == "System.Data.DataSet")
{
DataSet ds = (DataSet)result;
dgResult.DataSource = ds.Tables[0].DefaultView;
txtResult.Text = "";
}
else
{
txtResult.Text = result.ToString();
dgResult.DataSource = null;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -