govind singh

govind singh

  • NA
  • 41
  • 2.4k

I have to pass filename in window application exe

Sep 23 2016 4:23 PM
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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[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);
}
}
}
 
 
 

Answers (2)