SimpleClient(String, String) Constructor

Note: This API is now obsolete.

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#
[ObsoleteAttribute("Use another constructor.")]
public SimpleClient(
	string connectorConfiguration,
	string connectorsDirectory
)

Parameters

connectorConfiguration  String
Name of the connector configuration.
connectorsDirectory  String
The full path to the folder where connectors are.
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 NuGets. In this case, it is only necessary to define the connectorConfiguration and the connectorsDirectory will be null parameter. It is also possible to save the ConnectorConfiguration and connectorsDirectory in App.Config as:
C#
<appSettings><add key="ConnectorConfiguration" value="HttpClient" /><add key="ConnectorDirectory" value="C:/Program Files (x86)/Gamanet/C4/SimpleClient/Connectors" /></appSettings>
Therefore, Simple Client can be initialized with null parameters. In case SDK Simple Client NuGets are not installed, then it is necessary to define the connectorsDirectory parameter as the full path to client connector DLLs. SimpleClient will dynamically load the required references. It is also possible to save the connectorDirectory and ConnectorConfiguration parameter in the App.Config as:
C#
<appSettings><add key="ConnectorConfiguration" value="HttpClient" /><add key="ConnectorDirectory" value="C:/Program Files (x86)/Gamanet/C4/SimpleClient/Connectors" /></appSettings>
Therefore, Simple Client can be initialized with null parameters.
Example
The following example illustrates how to create SimpleClient object with configuration to connect to the C4Basic
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", null);
        // In case that ConnectorConfiguration or connectorsDirectory are stored in App.config you can initialize 
        // constructor with null parameters:
        // var client = new SimpleClient(null, null);

        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
    }
}
The following example illustrates how to create SimpleClient object with configuration to the C4 server with RestClient.
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, null);
        // In case that ConnectorConfiguration and connectorsDirectory are stored in App.config you can initialize 
        // constructor with null parameters:
        // var client = new SimpleClient(null, null);

        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

Reference

SimpleClient Class
SimpleClient Overload
Gamanet.C4.SDK Namespace