本文整理汇总了C#中IServer.GetAuthors方法的典型用法代码示例。如果您正苦于以下问题:C# IServer.GetAuthors方法的具体用法?C# IServer.GetAuthors怎么用?C# IServer.GetAuthors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServer
的用法示例。
在下文中一共展示了IServer.GetAuthors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bt_Start_Click
private void bt_Start_Click(object sender, EventArgs e)
{
try
{
tb_DeTai.Text = "";
lv_ThanhVien.Items.Clear();
if (ds_KetNoi.SelectedIndex == 0)
{
EndpointAddress address = new EndpointAddress(new Uri("http://localhost:8000/BasicHttpBinding"));
ChannelFactory<IServer> factory = new ChannelFactory<IServer>(new BasicHttpBinding(), address);
patientSvc = factory.CreateChannel();
for (int i = 0; i < patientSvc.GetAuthors().Count(); i++)
lv_ThanhVien.Items.Add(patientSvc.GetAuthors()[i]);
tb_DeTai.Text = patientSvc.DeTai();
}
else if (ds_KetNoi.SelectedIndex == 1)
{
EndpointAddress address = new EndpointAddress(new Uri("http://localhost:8000/WSHttpBinding"));
ChannelFactory<IServer> factory = new ChannelFactory<IServer>(new WSHttpBinding(), address);
patientSvc = factory.CreateChannel();
for (int i = 0; i < patientSvc.GetAuthors().Count(); i++)
lv_ThanhVien.Items.Add(patientSvc.GetAuthors()[i]);
tb_DeTai.Text = patientSvc.DeTai();
}
else if (ds_KetNoi.SelectedIndex == 2)
{
EndpointAddress address = new EndpointAddress(new Uri("net.tcp://localhost:8000/NetTcpBinding"));
ChannelFactory<IServer> factory = new ChannelFactory<IServer>(new NetTcpBinding(), address);
patientSvc = factory.CreateChannel();
for (int i = 0; i < patientSvc.GetAuthors().Count(); i++)
lv_ThanhVien.Items.Add(patientSvc.GetAuthors()[i]);
tb_DeTai.Text = patientSvc.DeTai();
}
}
catch (System.Exception ex)
{
MessageBox.Show("Không kết nối được !", "Thông báo", MessageBoxButtons.OK,MessageBoxIcon.Warning);
tb_DeTai.Text = "";
lv_ThanhVien.Items.Clear();
}
}