I'm wanting a batch file, send data to an exe file programmed in C#, and this data will be saved in variables in the program, is this possible? if yes how can i do that?
You can pass parameters via the commandline as documented here :
using System;
class TestClass
{
static void Main(string[] args)
{
// Display the number of command line arguments.
Console.WriteLine(args.Length);
}
}
An alternative would be to set environment variables and use their values within the program:
public static string? GetEnvironmentVariable (string variable);
Yes. The standard mechanisms are
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.