2
I was in need of some help with a code on moon, to generate parameters for the command line, and then collect them by another application, only in C#, to be more specific, I want to run a virtual keyboard C#, and in this execution I want to send the parameters of the coordinates from where it will appear by moon, that is, if I can generate the numbers of X and Y to the command line by moon and collect them by C#, I can handle the screen position.
The current code that had found by moon is:
local X = 20
local Y = 50
os.execute([[C:\\Users\\Public\\Documents\\netcoreapp3.1\\WindowsFormsApp2.exe X Y]])
It simply runs my keyboard and maybe generates the arguments of X and Y, but I don’t know how they are being treated.
What about the Code in C#, I have as a basis:
namespace WindowsFormsApp2
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
// Test if input arguments were supplied.
if (args.Length >= 0)
{
Console.ReadLine();
}
Console.WriteLine(args.Length);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Keyboard());
}
}
}
But I’m not sure what I’m getting, if anything, from the command line. Someone knows about it and give me a Help?
Obs:
Operating System: Windows 10
Programa C#: VisualStudio
when you run an application passing parameters they will see in the string[] args of the main
– Lucas Miranda
But do I have to specify the line or something? Maybe a: ;
int X = Console.ReadLine();
int Y = Console.ReadLine();
– Kauan Low
In the case instead of int would be string
– Kauan Low