我正在面對一個非常有趣的字符串問題。字符串連接不能正常工作
我的代碼是:
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