Files
UA-.NETStandard/SampleApplications/Samples/GDSClient/Program.cs
T
Erich Barnstedt f172b4e128 1. Created new prototyping branch from master
2. Added Publishers back in
3. Added GDS back in (currently not working)
2017-02-01 08:55:25 +01:00

46 lines
1.4 KiB
C#

using System;
using System.Windows.Forms;
using Opc.Ua.Configuration;
using System.Threading.Tasks;
using Opc.Ua.Client.Controls;
namespace Opc.Ua.GdsClient
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Initialize the user interface.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ApplicationInstance.MessageDlg = new ApplicationMessageDlg();
ApplicationInstance application = new ApplicationInstance();
application.ApplicationType = ApplicationType.Client;
application.ConfigSectionName = "Opc.Ua.GdsClient";
try
{
// load the application configuration.
Task<ApplicationConfiguration> task = application.LoadApplicationConfiguration(false);
task.Wait();
// check the application certificate.
Task<bool> task2 = application.CheckApplicationInstanceCertificate(false, 0);
task2.Wait();
// run the application interactively.
Application.Run(new MainForm(application));
}
catch (Exception e)
{
MessageBox.Show(application.ApplicationName + ": " + e.Message);
}
}
}
}