467,859 Members | 1,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,859 developers. It's quick & easy.

Information on command line arguments and more fun stuff.

Hello, I'm looking for information on handling command line arguments in my VB.NET (2003) application. What I have is an application that loads up a specific file type. What I want is when I double click the file icon it will launch the application and load up the information. Basically the same functionality as say Microsoft Word does when you double click on files of .doc type. Also is it possible in VB.NET to have just one instance of an application running?

If anybody knows a good resource for learning how to do this, it will be greatly appreciated.

Thank you.
Ryan
Nov 21 '05 #1
  • viewed: 2195
Share:
4 Replies
Hi,

Comand Line Args
http://msdn.microsoft.com/library/de...eargstopic.asp

Single Instance
http://www.windowsformsdatagridhelp.info/default.aspx

Associate File type with program
http://msdn.microsoft.com/library/de...extensions.asp

Ken
-------------------
"Ryan Chavez" <rt******@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Hello, I'm looking for information on handling command line arguments in my
VB.NET (2003) application. What I have is an application that loads up a
specific file type. What I want is when I double click the file icon it will
launch the application and load up the information. Basically the same
functionality as say Microsoft Word does when you double click on files of
..doc type. Also is it possible in VB.NET to have just one instance of an
application running?

If anybody knows a good resource for learning how to do this, it will be
greatly appreciated.

Thank you.
Ryan
Nov 21 '05 #2
"Ryan Chavez" <rt******@hotmail.com> schrieb:
What I want is when I double click the file icon it will launch the
application
and load up the information. Basically the same functionality as say
Microsoft Word does when you double click on files of .doc type.
Add this code to a module file and select 'Sub Main' as startup object in
the project properties:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
Console.WriteLine(Arg)
Next Arg
End Function
End Module
///
Also is it possible in VB.NET to have just one instance of an application
running?


Single instance:

<URL:http://www.yoda.arachsys.com/csharp/faq/#one.application.instance>

File associations:

<URL:http://www.mentalis.org/soft/class.qpx?id=5>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Wow! Thanks for the links they are extreamly helpful. I had no clue what a
mutex is but I'll have to look into it.
Very much appreciated, thank you.

Ryan

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ec**************@TK2MSFTNGP09.phx.gbl...
Hi,

Comand Line Args
http://msdn.microsoft.com/library/de...eargstopic.asp

Single Instance
http://www.windowsformsdatagridhelp.info/default.aspx

Associate File type with program
http://msdn.microsoft.com/library/de...extensions.asp

Ken
-------------------
"Ryan Chavez" <rt******@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Hello, I'm looking for information on handling command line arguments in
my
VB.NET (2003) application. What I have is an application that loads up a
specific file type. What I want is when I double click the file icon it
will
launch the application and load up the information. Basically the same
functionality as say Microsoft Word does when you double click on files of
.doc type. Also is it possible in VB.NET to have just one instance of an
application running?

If anybody knows a good resource for learning how to do this, it will be
greatly appreciated.

Thank you.
Ryan

Nov 21 '05 #4
Again thanks for the helpful links. I like Ken's recommendation of using the
Environment.GetCommandLineArgs() static function over the specified Sub Main
that you had. Although, depending on how I work out things I may use that
one instead. Also thank you for the wonderful yoda link. It had a lot of
good information there and a few questions that I've always wondered were
found there as well.
Again very much appreciated. Thank you.

Ryan

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e0**************@tk2msftngp13.phx.gbl...
"Ryan Chavez" <rt******@hotmail.com> schrieb:
What I want is when I double click the file icon it will launch the
application
and load up the information. Basically the same functionality as say
Microsoft Word does when you double click on files of .doc type.


Add this code to a module file and select 'Sub Main' as startup object in
the project properties:

\\\
Public Module Program
Public Function Main(ByVal Args() As String) As Integer
For Each Arg As String In Args
Console.WriteLine(Arg)
Next Arg
End Function
End Module
///
Also is it possible in VB.NET to have just one instance of an application
running?


Single instance:

<URL:http://www.yoda.arachsys.com/csharp/faq/#one.application.instance>

File associations:

<URL:http://www.mentalis.org/soft/class.qpx?id=5>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ever Olano | last post: by
6 posts views Thread by jonathan | last post: by
1 post views Thread by Rune Jacobsen | last post: by
40 posts views Thread by raphfrk | last post: by
13 posts views Thread by Chris Carlen | last post: by
2 posts views Thread by william.w.oneill | last post: by
5 posts views Thread by inetquestion | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.