Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ServiceReference1.SamplesClient proxy = new Client_WithSecurity.ServiceReference1.SamplesClient("netTcp");

            //proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential(@"MICROSOF-6A33BE\peter",
            //                                                                            "123");

            try
            {
                Console.WriteLine(proxy.GetMemberCode());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                Console.WriteLine(proxy.GetPublicCode());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                Console.WriteLine(proxy.GetSecretCode());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     ServiceReference1.SamplesClient proxy = new Client_WithSecurity.ServiceReference1.SamplesClient("netTcp");
     
     //proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential(@"MICROSOF-6A33BE\peter",
     //                                                                            "123");
     
     try
     {
         Console.WriteLine(proxy.GetMemberCode());
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     try
     {
         Console.WriteLine(proxy.GetPublicCode());
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     try
     {
         Console.WriteLine(proxy.GetSecretCode());
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
    
    
 }