This tutorial explains how to install LINK2i from scratch. Follow all the steps to complete the installation of LINK2i in your environment.
To complete this tutorial, you need:
If you only have one SECOFR account on the targeted IBM i partition, we recommend you to create a new SECOFR user account dedicated to LINK2i administration.
Create a new .NET Framework C# or VB.NET console application in Visual Studio:
In this new console application, reference LINK2i using the NuGet package manager:
For more details about NuGet packages, visit Microsoft documentation on NuGet packages installation in Visual Studio.
The license key can be automatically registered on the IBM i using LINK2i RegisterLicenseKey() function. To perform the registration, add the following code in the main method Program.cs (or Program.vb):
//Code to insert in Main method from Program.cs
Link2i link2i = new Link2i();
string result;
string createOrRenew = Link2i.TypeRegister.CRT;
//Replace the values in the parameters below
string lparIP = "192.168.2.19"; //IBM i LPAR IP address
string usrName = "QSECOFR"; //SECOFR account username
string usrPassword = "PW1234"; //SECOFR account password
string licenseKey = "...mpoOuLXn3D6WnjAjk=…"; //LINK2i license key
result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew);
Console.Writeline(result);
Console.ReadLine();
'Code to insert in Main method from Program.vb
Dim link2i As New Link2i
Dim result As String
Dim createOrRenew As String = Link2i.TypeRegister.CRT
'Replace the values in the parameters below
Dim lparIP As String = "192.168.2.19" 'IBM i LPAR IP address
Dim usrName As String = "QSECOFR" 'SECOFR account username
Dim usrPassword As String = "PW1234" 'SECOFR account password
Dim licenseKey As String = "...mpoOuLXn3D6WnjAjk=…" 'LINK2i license key
result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew)
Console.Writeline(result)
Console.ReadLine()
Program.cs (or Program.vb) should look like the code below:
//Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InstallLink2i
{
class Program
{
static void Main(string[] args)
{
Link2i link2i = new Link2i();
string result;
string createOrRenew = Link2i.TypeRegister.CRT;
string lparIP = "192.168.2.19"; //IBM i LPAR IP address
string usrName = "QSECOFR"; //SECOFR account username
string usrPassword = "PW1234"; //SECOFR account password
string licenseKey = "...mpoOuLXn3D6WnjAjk=…"; //LINK2i license key
result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew);
Console.Writeline(result);
Console.ReadLine();
}
}
}
'Program.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Namespace InstallLink2i
class Program
Private Shared Sub Main(ByVal args As String())
Dim link2i As New Link2i
Dim result As String
Dim createOrRenew As String = Link2i.TypeRegister.CRT
Dim lparIP As String = "192.168.2.19" 'IBM i LPAR IP address
Dim usrName As String = "QSECOFR" 'SECOFR account username
Dim usrPassword As String = "PW1234" 'SECOFR account password
Dim licenseKey As String = "...mpoOuLXn3D6WnjAjk=…" 'LINK2i license key
result = link2i.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew)
Console.Writeline(result)
Console.ReadLine()
End Sub
End Class
End Namespace
Run the code. LINK2i is now fully installed, you only have to perform this process once to fully use LINK2i from different clients. When using LINK2i in a new .NET project, only a reference to the NuGet package is required.
You can now check the installation by following one of these tutorials: