字符串中的引号 [英] Quotes within a string
问题描述
我很困惑!
我有以下代码:
Dim InputFile As String =" H:\Downloads\A Video.mp4"
Dim OutputFile As String =" H:\Downloads\A Video.mp3"
Dim Parameter As String =" -i"& Chr(34)& InputFile& Chr(34)&" -vn -c:a libmp3lame -b:a 128k
-ar 44100 -ac 2 -y"& Chr(34)& OutputFile
使用Visual Studio 2010执行后
和 Visual Studio 2013(Netframe = 4.0)我得到:
After execution with Visual Studio 2010 and Visual Studio 2013 (Netframe=4.0) I get:
参数=" -i" H:\Downloads \A Video.mp4" -vn -c:a libmp3lame -b:a 128k -ar 44100 -ac 2 -y"H :\Downloads\A
Video.mp3"
这就是我所期望的。为什么然后用Visual Studio 2015执行
和 Visual Studio 2017(Netframe = 4.0)我得到:
This is what I would have expected. Why then after execution with Visual Studio 2015 and Visual Studio 2017 (Netframe=4.0) I get:
参数=" -i"" H:\Downloads\A Video.mp4"" -vn -c:a libmp3lame -b:a 128k -ar 44100 -ac 2 - y"" H:\Downloads\A
Video.mp3"
字符串中的引号显然是一个问题,但我无法理解为什么?
推荐答案
我很困惑!
我有以下代码:
Dim InputFile As String =" H:\Downloads\A Video.mp4"
Dim OutputFile As String =" H:\Downloads\A Video.mp3"
Dim Parameter As String =" -i"& Chr(34)& InputFile& Chr(34)&" -vn -c:a libmp3lame -b:a 128k
-ar 44100 -ac 2 -y"& Chr(34)& OutputFile
使用Visual Studio 2010执行后
和 Visual Studio 2013(Netframe = 4.0)我得到:
After execution with Visual Studio 2010 and Visual Studio 2013 (Netframe=4.0) I get:
参数=" -i" H:\Downloads \A Video.mp4" -vn -c:a libmp3lame -b:a 128k -ar 44100 -ac 2 -y"H :\Downloads\A
Video.mp3"
这就是我所期望的。为什么在执行之后,完全相同的代码,使用Visual Studio 2015
和 Visual Studio 2017(Netframe = 4.0)我得到:
This is what I would have expected. Why then after execution, exactly the same code, with Visual Studio 2015 and Visual Studio 2017 (Netframe=4.0) I get:
参数=" -i"" H:\Downloads\A Video.mp4"" -vn -c:a libmp3lame -b:a 128k -ar 44100 -ac 2 - y"" H:\Downloads\A
Video.mp3"
显然字符串中的引号存在问题,但我无法理解为什么?
这篇关于字符串中的引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!