II have to pass filename in window application exe, but not getting through command line my functions in like below; i am running like cmd\k"WindowsFormsApplication6.exe" test
not getting test in main function call
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
//using SHDocVw;
using System.Reflection;
using System.Threading;
using Microsoft.Office.Interop.Word;
using System.Threading.Tasks.Schedulers;
using System.Configuration;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Drawing.Printing;
using System.IO;
namespace WindowsFormsApplication6
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//foreach(string arg in args)
//{
// Console.WriteLine(arg);
//}
foreach (string arg in Environment.GetCommandLineArgs())
{
Console.WriteLine(arg);
}
Console.WriteLine(args.Length);
}
}
}
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Sep 24, 2016, 1:29 AM
Tapan PatelPosted Sep 23, 2016, 4:30 PM