Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Windows Forms App as Console App

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry - 09 Jul 2007 16:12 GMT
Hi

I want to start a Visual Basic Windows Form app from the console by
specifying parameters (this is possible in C#), is i add the following
method i get a error

   Public Sub Main(ByVal args As String())
       Console.Write(args.Length)
   End Sub

the above method works in a console app.

can someone help in this regard

TIA
Barry
Alex Meleta - 09 Jul 2007 16:57 GMT
Hi Barry,

What error do you get and where?
Anyway, do you want to use console app to start any other app (winforms or
such)? If so, then use:

[c#] System.Diagnostics.Process.Start("some.exe", string.Join(" ", args))

Regards, Alex Meleta
[TechBlog] http://devkids.blogspot.com

B> Hi
B>
B> I want to start a Visual Basic Windows Form app from the console by
B> specifying parameters (this is possible in C#), is i add the
B> following method i get a error
B>
B> Public Sub Main(ByVal args As String())
B> Console.Write(args.Length)
B> End Sub
B> the above method works in a console app.
B>
B> can someone help in this regard
B>
B> TIA
B> Barry
Patrice - 09 Jul 2007 17:32 GMT
See :
System.Environment.GetCommandLineArgs

Seeing command line arguments as arguments for the main function is a C like
language "tradition".

You may want to elaborate a bit as I'm not sure to understand what you are
trying to do (of couse Console.Write won"t work in a Windows applciation).
My understanding ois that you want to launch a Windows application and
reading possible command line arguments passed when starting this Windows
application.

---

Patrice

> Hi
>
[quoted text clipped - 12 lines]
> TIA
> Barry
Barry - 10 Jul 2007 08:23 GMT
Yes, i want to start a Winforms app (VB not C#)  using command parameters

> See :
> System.Environment.GetCommandLineArgs
[quoted text clipped - 28 lines]
>> TIA
>> Barry

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.