Mono on IBM i Code Samples
This repository will be used to publish .Net and IBM i code samples related to running .Net on IBM i.
Feel free to contribute your own .Net samples and I will publish them here.
Mono on i
You will first need to have the Mono on i environment installed on your IBM i.
Mono for IBM i binary save file distribution can be downloaded from here:
Mono on i Library
If you want to easily call .Net applications on IBM i and integrate into standard job streams such as CL or RPG, download and install this library on your IBM i as well.
If you don't install the MONOI library you will need to call your .Net applications from a PASE QP2TERM command line for testing. The MONO command makes things much easier.
Sample Program ReadMe Files
MonoHelloWorld - Sample template for Mono .Net console apps
MonoListTimeZones - Sample for listing all the time zones available to a Mono .Net App since standard system values or PASE environment values don't work.
MonoRunPase - Sample for running db2 cli, CL system commands, Qshell or PASE commands from a .Net App.
MonoXmlToCsv - Sample for an XML file to a CSV file.
MonoDirList - Sample of crawling IBM i IFS directory tree to list all objects in selected subdirectory and children to an IFS file and OUTFILE PF.
MonoMailSend - This is a production ready mail sender command for sending email from an IBM i system using the Mailkit/Mimekit mail API which can be used to create text and html email messages. Send directly via Office365, Gmail or any other secure or unsecure SMTP server.
Installing Samples in IFS Using Git
You can download the zip file from github and unzip the Visual Studio projects or install them in the IFS by using the following git command sequences to clone the repository.
From an IBM i 5250 session, start QShell or PASE command line terminal:
STRQSH or CALL QP2TERM
Change to the root folder. For this example we will be cloning code to /MonoOniSamples IFS directory from the root directory:
Call the following command line to clone the repository to /MonoOniSamples folder
git -c http.sslVerify=false clone --recurse-submodules https://github.com/richardschoen/MonoOniSamples.git
If all ran successfully you should have a new folder named /MonoOniSamples available on your IFS.