0

My application creates files with a ".mhm" extension.

I'd like for my application to open and process these files when I double-click them. Current behavior is that when I double-click the file, my application opens but does not process the file.

How can I read the args parameter of Main() method in C# 2008?

5
  • Cleanup and Spellcheck needed on Question 1455036... Commented Sep 21, 2009 at 15:17
  • Did anyone understand anything ? Commented Sep 21, 2009 at 15:18
  • I want load my file's that save my application.what do i do? Commented Sep 21, 2009 at 15:27
  • Mohammad, you have accepted an answer to your identical question previously. Am I missing something? Commented Sep 21, 2009 at 15:34
  • Dupe of stackoverflow.com/questions/1449546/… Commented Sep 21, 2009 at 15:35

2 Answers 2

2

"Hi

My Application creates files with the .MHM file extension. I would like my application to be associated with this file extension so that when a MHM file is executed, my application is too, with the file path as the arguments for the main method of my application."

That's what I understood.

Grzenio has the right idea -

public void static Main(string args[])
{ 
...
}

but to push your application into the shell would take extra research, you'd have to look into integrating your application into the Shell (using the registry).

See here: script-to-associate-an-extension-to-a-program

EDIT: Thanks for the edit of the question Chris, trying to see things a bit wider here... Perhaps the arguments solution was all the OP needed.

Sign up to request clarification or add additional context in comments.

Comments

2

If I understand your question correctly you just use:

public void static Main(string args[])
{
...
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.