开发者

String concatenation is not working properly

开发者 https://www.devze.com 2023-01-27 05:59 出处:网络
I am facing a really very interesting problem with string. My code is: Dim stropt As String stropt = \" -i \"\"C:\\Rajesh Prj\\Video splitter\\testvideo.wmv\"\" -start 00:00:00 -duration 00:00:10 -

I am facing a really very interesting problem with string.

My code is:

Dim stropt As String

stropt = " -i ""C:\Rajesh Prj\Video splitter\testvideo.wmv"" -start 00:00:00 -duration 00:00:10 -start 00:00:10 -duration 00:00:10 -sep -o short{000}.wmv"
'Dim strwithpara As String
'strwithpara = " -i """ + filepath + """ -start 00:00:00 -duration 00:00:10 -start 00:00:10 -duration 00:00:10 -sep -o short{000}.wmv"

System.Diagnostics.Process.Start(Environment.CurrentDirectory() + "\asfbin.exe", stropt)

with above code its working fine, but when I uncomment the middle two lines, its giving me :

error: The system cannot find the file specified

even though I am not using variable strwithpara but its generating that error in Process.Start.

But when I comment those lines (which are u开发者_如何学Goncommented in code above) its working fine. Please tell me what I am missing and also suggest to me what should I do to resolve it.

I am taking value in filepath variable from file dialog's FileName property.

EDIT: I have also compared the values of variable stropt and strwithpara with "IF" condition and found those are same.


Check the value of Environment.CurrentDirectory() + "\asfbin.exe" and stropt using breakpoints and see if they match what you expect

0

精彩评论

暂无评论...
验证码 换一张
取 消