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 / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Muti-parameter for System.diagnostics.process.start() ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kimiraikkonen - 30 Sep 2007 23:19 GMT
Hello,
I want to ask this:

If i do:   System.Diagnostics.Process.Start("c:\lame", "--preset
standard c:\blabla.wav c:\blabla.mp3") it works.

But i don't want this. I want my 2 textboxes must take place as
variable like: System.Diagnostics.Process.Start("c:\lame", "--preset
standard textbox1" textbox1.text +
textbox2.text). But that doesn't work. Meanwhile textboxes are the
filename paths.

How can i run my process with more than one parameter using user
variables like placed in textboxes?

Very thanks.
Family Tree Mike - 01 Oct 2007 01:35 GMT
This should work:

System.Diagnostics.Process.Start("c:\lame", _
 "--preset standard textbox1" + textbox1.text + textbox2.text).

You were missing one plus sign.  If you copied wrong and actually had the
plus sign, then it should have worked.  You may need to quote some of the
strings, if they contain spaces.  Spaces are assumed to separate the
arguments, so quoting it will allow for a space in an argument.

Hope this helps.

> Hello,
> I want to ask this:
[quoted text clipped - 12 lines]
>
> Very thanks.
Family Tree Mike - 01 Oct 2007 02:10 GMT
Andrew is correct, that there should be a + " " + between the two textbox
items.

> This should work:
>
[quoted text clipped - 24 lines]
> >
> > Very thanks.
rowe_newsgroups - 01 Oct 2007 11:26 GMT
On Sep 30, 9:10 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.com> wrote:
> Andrew is correct, that there should be a + " " + between the two textbox
> items.
[quoted text clipped - 27 lines]
>
> > > Very thanks.

For hard to read concatenations, I tend to use the String.Format()
option:

Process.Start("C:\lame", _
 String.Format("--preset standard {0} {1}", textBox1.Text,
textBox2.Text))

(imo) It makes spacing and other concerns much easier to look at.

Thanks,

Seth Rowe
kimiraikkonen - 01 Oct 2007 19:13 GMT
Thanks all :) Multi-parameter launch is OK now but i couldn't hide my
process while processing. It's still shown on the screen.

Dim myProcess As System.Diagnostics.Process = New
System.Diagnostics.Process()
           myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden
           myProcess = System.Diagnostics.Process.Start("c:\lame",
"--preset standard" + textbox1.text + " " +
textbox2.text).
           myProcess.WaitForExit()
           MsgBox("Conversion Completed Successfully",
MsgBoxStyle.Information, "Completed")
Andrew Jackson - 01 Oct 2007 01:41 GMT
Looks to me you forgot one of your str concats

System.Diagnostics.Process.Start("c:\lame","--preset
standard"+textbox1.text+" "+textbox2.text)

> Hello,
> I want to ask this:
[quoted text clipped - 12 lines]
>
> Very thanks.
Andrew Jackson - 01 Oct 2007 01:42 GMT
Mybad you also probably need to put a space after standard in my reply
below.

System.Diagnostics.Process.Start("c:\lame","--preset standard
"+textbox1.text+" "+textbox2.text)

> Looks to me you forgot one of your str concats
>
[quoted text clipped - 17 lines]
>>
>> Very thanks.

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.