gclib  2.0.8
Communications API for Galil controllers and PLCs
remote_server_example.cs
Go to the documentation of this file.
1 
11 using System;
12 using System.Linq;
13 
14 namespace examples
15 {
23 
25  {
32  public static int Main(string[] args)
33  {
34  int rc = Examples.GALIL_EXAMPLE_OK;
35 
36  try
37  {
38  string server_name;
39 
40  if (args.Count() < 1)
41  {
42  Console.Write("Enter server name: ");
43  server_name = Console.ReadLine();
44  }
45  else
46  {
47  server_name = args[0];
48  }
49 
50  rc = Examples.Remote_Server(server_name);
51  }
52  catch (Exception ex)
53  {
54  Console.WriteLine(ex.Message);
56  }
57 
58  Console.Write("\nPress any key to close the example");
59  Console.ReadKey();
60 
61  return rc;
62  }
63  }
65 }
Provides a class of shared constants and methods for gclib's example projects.
Definition: commands.cs:16
const int GALIL_EXAMPLE_OK
Examples success code.
Definition: examples.cs:29
const int GALIL_EXAMPLE_ERROR
Examples error code.
Definition: examples.cs:30
static int Main(string[] args)
Main function for the Remote Server example.
Demonstrates various uses of GPublishServer()
static int Remote_Server(string server_name)
Accepts user input to publish or remove local gcaps server from the network.