我正在面对一个非常有趣的字符串问题。字符串连接不能正常工作
我的代码是:
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)
与上面的代码它工作正常,但是当我去掉中间的两条线,它给我:
error: The system cannot find the file specified
即使我没有使用可变strwithpara
但它在Process.Start
中产生了该错误。
但是,当我评论这些行(在上面的代码中未注释),它的工作正常。 请告诉我我错过了什么,并建议我该怎么做才能解决它。
我在文件对话框的FileName
属性中获取filepath
变量的值。
编辑:我还将变量stropt
和strwithpara
的值与“IF”条件进行了比较,发现它们是相同的。
我无法与你所提供的代码来重现问题。对于我的两条中间线都没有注释,它对我来说工作得很好。 – 2010-11-24 12:35:04