示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            localhost.CounterServiceClient proxy = GetProxy();
            try
            {
                proxy.IncrementCounter();
                proxy.ThrowFault();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            try
            {
                proxy.IncrementCounter();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            try
            {
                proxy.Close();
            }
            catch { }
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     localhost.CounterServiceClient proxy = GetProxy();
     proxy.IncrementCounter();
     proxy.IncrementCounter();
 }