2012-08-09 98 views

回答

2

它根本不清楚你在问什么。如果你这样做,结果字符串将是*.doc,*.docx。如果你想倒逗号(引号),你会做这样的事情:

str = Chr$(34) & "*.doc" & Chr$(34) & "," & Chr$(34) & "*.docx" & Chr$(34) 

这将产生类似

"*.doc","*.docx" 

这是你在找什么?如果没有,让我们知道你想要完成什么,我们可以帮助你。

4

写入字符串,只要你想它代表:

str = "*.doc" & "," & "*.docx" 

双引号逃脱他们:

str = ""*.doc"" & "","" & ""*.docx"" 

然后引用串整:

str = """*.doc"" & "","" & ""*.docx""" 

?str 
"*.doc" & "," & "*.docx" 
0

我测试了这个与一个消息框,它为我工作得很好。

Dim str As String = "*.doc" & "," & "*.docx" 
textbox1.text = str 
1

这对我有用,试试吧。

Dim str As String = """ * .doc"" & "","" & ""*.docx """ 
TextBox1.Text = str 
0

VB6代码:

Dim str As String 
str = "*.doc" & "," & "*.docx" 
Text1.Text = str 

VB.net代码:

Dim str As String 
str = "*.doc" & "," & "*.docx" 
TextBox1.Text = str 

这两项工作。