mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-22 09:37:12 +08:00
bfecd8bc8b
2. Added generate cert script to project files. 3. Made "\\" platform independent, even for .Net4 samples (apart from GDS samples). 4. Fixed cert validation popups (yes/no was reversed!). 5. Got GDS server and client samples running (no connection yet). 6. Fixed configuration and popups in GDS client.
46 lines
1.4 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|