Simple |
Initializes a new instance of the SimpleClient class.
Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public SimpleClient( string connectorConfiguration )
Parameters
- connectorConfiguration String
- Name of the connector configuration.
Remarks
In the example we explain the recommended way of creating a Simple Client instance, in case you are using
Simple Client Template or SDK Simple Client NuGet
In this case, it is only necessary to define the connectorConfiguration.
It is also possible to save the ConnectorConfiguration in App.Config as:
Therefore, Simple Client can be initialized with the null parameter.
Example
The following example illustrates how to create SimpleClient object to connect to the C4Basic
The following example illustrates how to create SimpleClient object to connect to the C4 server with RestClient.
C#
using System; using Gamanet.C4.SimpleInterfaces; using Gamanet.C4.SDK; public class C4BasicConfiguration { static void Main() { // Create instance of simple client with configuration for C4Basic var client = new SimpleClient(C4Basic); ConnectionInfo token; var connectionResult = client.Connect(new Uri("localdb:/"), "Support", "support", out token); Console.WriteLine("Connection result: {0}", connectionResult); // The example displays the following output: // Connection result: Successful } }
C#
using System; using Gamanet.C4.SimpleInterfaces; using Gamanet.C4.SDK; public class RestClientConfiguration { static void Main() { // Create instance of simple client with configuration for RestClient (connection to C4 server) var client = new SimpleClient(ConnectorConfiguration.HttpClient); ConnectionInfo token; var connectionResult = client.Connect(new Uri("https://localhost/"), "Support", "support", out token); Console.WriteLine("Connection result: {0}", connectionResult); // The example displays the following output: // Connection result: Successful } }
See Also