Manh Thao

Manh Thao

  • NA
  • 11
  • 0

Problem with void main(function) when registing program in window context menu

Mar 19 2012 10:59 PM
The problem I encountered when registration of my program in Windows Context Menu

But I'm having trouble in void main() function. To get the path parameter, the function void main() will be:
static void Main(string[] args)
{

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

frmMain main = new frmMain();
MainTool.frmmain = main;

Application.Run(main);

}
In void main() function:

frmMain main = new frmMain();
MainTool.frmmain = main;

Perform logic checking of data in Excel file (inherited from MainTool class in the project)

And I do not know how to get args [0] for the main variables to get the path program. Like this:

Application.Run(main(args[0]);
I tried several times but have not been successful!

Detail about question: http://www.c-sharpcorner.com/Forums/Thread/164970/how-to-get-the-path-parameter-in-voidmain-function-add-prog.aspx


Answers (2)