2015-06-05 39 views

回答

1

這裏有一個選項:

"text" & Chr(34) & textbox1.text & Chr(34) 
2

它不應該是這樣?

"text""" + textbox1.text + """" 

如果我沒記錯的話雙引號就是如何在VB中逃避報價。

在C#這將是

"text\"" + textbox1.Text + "\"" 
// or (with a verbatim string) 
@"text""" + textbox1.text + @"""" 
// more logic use of verbatim string (especially if you 
// want to create a string with multiple lines) 
string.Format(@"text""{0}""", textbox1.Text); 

\」是指在C#中的字符串中的雙引號字符

‘’表示雙引號字符在VB或者C#的逐字字符串串

在逐字字符串\不會再逃避這樣有一個逐字字符串中,還必須像在VB.Net 一倍內報價(不同的措辭,VB.Net字符串都是逐字字符串)