如何附加复选框状态待处理的文本?
我正在制作一个带有复选框的表单,如果选中,目标文件将附加文本 A,如果未选中,文件将附加文本 B
我该如何执行此操作?
到目前为止我所拥有的:
Private Sub CheckBox1_Checked(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.Checked
Dim FILE_NAME As String = "C:\ANSWERSLIST.txt"
'Adding items for AutoCAD 2006...
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
objWriter.WriteLine("YES")
objWriter.Close()
End If
End Sub
I’m making a form with a checkbox where if checked a target file is appended with text-A and if Unchecked the file is appended with text-B
How can I do this?
what i have sofar:
Private Sub CheckBox1_Checked(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.Checked
Dim FILE_NAME As String = "C:\ANSWERSLIST.txt"
'Adding items for AutoCAD 2006...
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
objWriter.WriteLine("YES")
objWriter.Close()
End If
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 AppendAllText 方法:
You could use the AppendAllText method: