我是 Visual Basic 的新手,我正在尝试使用此代码创建一个文件
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim curboard As String = comboard.SelectedItem
Dim curstd As String = comstd.SelectedItem
Dim curdiv As String = comdiv.SelectedItem
Dim curmed As String = commed.SelectedItem
Dim filepath As String = "c:\program files\School Attandance Management System 1.0\data\" & curdiv & ".samsclass"
Try
File.Create(filepath)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
这输出
路径中的非法字符
comdiv、comstd、commed 和 comboard 是组合框 请告诉我如何将变量连接到文件路径中?