请问高手,为什么openfiledialog对话框获取的filename属性值不能被streamwriter写进流文档呢?
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.ClickDim svsys As New IO.StreamWriter("sys.ini", False)
svsys.WriteLine(TextBox1.Text)
svsys.WriteLine(TextBox4.Text) '就是这一条,手工输入的能写进去,用OpenFileDialog对话框获取的值就写不进去
svsys.Close()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
TextBox4.Text = OpenFileDialog1.FileName.ToString
End Sub
----------------------------------------------------------------------------------
二楼能正常保存吗?我又试了一下还是不行啊,我补传了附件上来了,手工输入到路径文本框的字符就能保存,openfile对话框的name属性传到路径文本框的字符就不能保存。
test.rar
(17.71 KB)
[ 本帖最后由 fdakerry 于 2009-10-24 13:16 编辑 ]