当前位置: 首页>>代码示例>>C#>>正文


C# IService.GetAuthors方法代码示例

本文整理汇总了C#中IService.GetAuthors方法的典型用法代码示例。如果您正苦于以下问题:C# IService.GetAuthors方法的具体用法?C# IService.GetAuthors怎么用?C# IService.GetAuthors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IService的用法示例。


在下文中一共展示了IService.GetAuthors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: bt_Start_Click

 private void bt_Start_Click(object sender, EventArgs e)
 {
     try
     {
         if (ds_KetNoi.SelectedIndex == 0)
         {
             address = new EndpointAddress(new Uri("http://localhost:8000/BasicHttpBinding"));
             factory = new ChannelFactory<IService>(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)
         {
             address = new EndpointAddress(new Uri("http://localhost:8000/WSHttpBinding"));
             factory = new ChannelFactory<IService>(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)
         {
             address = new EndpointAddress(new Uri("net.tcp://localhost:8000/NetTcpBinding"));
             factory = new ChannelFactory<IService>(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();
     }
 }
开发者ID:hoang14214,项目名称:Nhom20,代码行数:39,代码来源:Nhom20_MayTram.cs

示例2: btn_Author_BasHttp_Click

        private void btn_Author_BasHttp_Click(object sender, EventArgs e)
        {
            // try
               // {
                address = new EndpointAddress("http://localhost:" + txtLLocaBasHttp.Text + "/GetMark_Service");
                BasicHttpBinding binding = new BasicHttpBinding();
                proxy = ChannelFactory<IService>.CreateChannel(binding, address);

                lstMem = proxy.GetAuthors();
                grid_basHttp.DataSource = lstMem;
              //  }
              //  catch
              //  {
              //      MessageBox.Show("Service not responding!", "Warning", MessageBoxButtons.OK);
              //  }
        }
开发者ID:windynguyen,项目名称:GroupOneProject,代码行数:16,代码来源:frmMain_Client.cs

示例3: btn_Author_WsHttp_Click

        private void btn_Author_WsHttp_Click(object sender, EventArgs e)
        {
            try
            {
                address = new EndpointAddress("http://localhost:" + txtLLocaWsHttp.Text + "/GetMark_Service");
                WSHttpBinding binding = new WSHttpBinding();

                proxy = ChannelFactory<IService>.CreateChannel(binding, address);
                lstMem = proxy.GetAuthors();
                grid_WsHttp.DataSource = lstMem;
            }
            catch (CommunicationException commProblem) //lỗi giao tiếp với server
            {
                MessageBox.Show("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
            }
        }
开发者ID:windynguyen,项目名称:GroupOneProject,代码行数:16,代码来源:frmMain_Client.cs

示例4: btn_Author_netNamePipe_Click

        private void btn_Author_netNamePipe_Click(object sender, EventArgs e)
        {
            try
            {
                address = new EndpointAddress("net.pipe://localhost/GetMark_Service");

                NetNamedPipeBinding binding = new NetNamedPipeBinding();

                proxy = ChannelFactory<IService>.CreateChannel(binding, address);
                lstMem = proxy.GetAuthors();
                grid_netNPipe.DataSource = lstMem;
            }
            catch
            {
                MessageBox.Show("Service not responding!", "Warning", MessageBoxButtons.OK);
            }
        }
开发者ID:windynguyen,项目名称:GroupOneProject,代码行数:17,代码来源:frmMain_Client.cs


注:本文中的IService.GetAuthors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。