[英]TextBox writing on one line only
When ever I type something IN a textbox, than I click the button, I have a writeline.当我在文本框中键入内容时,而不是单击按钮,我就有了一条写行。 Is there a way to assign that one text box to only the first line, and the second text box to the second line on a notepad?有没有办法只将那个文本框分配给记事本上的第一行,将第二个文本框分配给第二行? So when you type something new in it, it will delete what you previously had on the first line, than add the new thing in the text box?因此,当您在其中输入新内容时,它会删除您以前在第一行中的内容,而不是在文本框中添加新内容?
I am using.我在用。
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("C:/Users/Nick/Documents/Dra.txt", True)
file.WriteLine(NameBasic)
file.WriteLine(LastBasic)
file.Close()
Second argument in OpenTextFileWriter()
method is append
. OpenTextFileWriter()
方法中的第二个参数是append
。 It means that strings will be appended to the end of the file if it get True
value.这意味着如果它获得True
值,字符串将被附加到文件的末尾。
Try to use False
instead:尝试使用False
代替:
file = My.Computer.FileSystem.OpenTextFileWriter("C:/Users/Nick/Documents/Dra.txt", False)
UPD UPD
Dim read As String = Console.ReadLine()
Dim num As Integer
Integer.TryParse(read, num)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.