aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp/helloworld/GreeterClient/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/csharp/helloworld/GreeterClient/Program.cs')
-rw-r--r--examples/csharp/helloworld/GreeterClient/Program.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/csharp/helloworld/GreeterClient/Program.cs b/examples/csharp/helloworld/GreeterClient/Program.cs
new file mode 100644
index 0000000000..279cee07e1
--- /dev/null
+++ b/examples/csharp/helloworld/GreeterClient/Program.cs
@@ -0,0 +1,24 @@
+using System;
+using Grpc.Core;
+using Helloworld;
+
+namespace GreeterClient
+{
+ class Program
+ {
+ public static void Main(string[] args)
+ {
+ Channel channel = new Channel("127.0.0.1:50051", Credentials.Insecure);
+
+ var client = Greeter.NewClient(channel);
+ String user = "you";
+
+ var reply = client.SayHello(new HelloRequest { Name = user });
+ Console.WriteLine("Greeting: " + reply.Message);
+
+ channel.ShutdownAsync().Wait();
+ Console.WriteLine("Press any key to exit...");
+ Console.ReadKey();
+ }
+ }
+}