简体   繁体   中英

How to create a CMD command ifor my C# windows application?

I Want to Create a CMD command for my C3 form application I want my app tp run normal when double clicking on it's icon but do some specitic job by running a comman0d in c0m0d forexample the app clear datbase by running

C:\myapp.exe /cleardata

command in CMD.

I am aware that not everyone here speaks perfect english and some people have trouble expressing their problem.

I am guessing you want to call your app from cmd and passing parameter to it.

You can read passed args in your main method.

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(args[0]);
    }
}

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM